Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts

    if you like rpgs

    if you like rpgs this is a cool script, the reason for the speed thing is to see how many turns you get, the enemy only gets one. You can edit it for your own porpuses but give me credit if you use it. You have to roll a three or above to attack.


    <html>
    <head>
    <title>test</title>
    <script language="javascript">
    function stats() {
    spd = prompt("Please enter your speed", "Enter your speed");
    spd0 = spd;
    }
    function di() {
    var ran_num = Math.round(5*Math.random()) + 1;
    document.form1.res.value = ran_num;
    if (document.form1.res.value > 3) {
    var ran_num0 = Math.round(5*Math.random()) + 1;
    document.form1.res0.value = ran_num0}
    else document.form1.res0.value = "0";
    document.form1.put.disabled=true;
    }
    function di0() {
    var ran_num = Math.round(5*Math.random()) + 1;
    document.form1.edmg.value = ran_num;
    if (document.form1.edmg.value > 3) {
    var ran_num0 = Math.round(5*Math.random()) + 1;
    document.form1.edmg0.value = ran_num0}
    else document.form1.edmg0.value = "0";
    document.form1.edi.disabled=true
    document.form1.hit0.disabled=false;
    }
    function dmg() {
    --spd0;
    var fh = document.form1.foehealth.value;
    document.form1.foehealth.value = fh - document.form1.res0.value;
    document.form1.foehealth.value = fh - document.form1.res0.value
    if (spd0 <= 0) {
    document.form1.hit.disabled=true;
    document.form1.edi.disabled=false;
    }
    document.form1.res.value = "";
    document.form1.res0.value = "";
    document.form1.put.disabled=false;
    if (document.form1.foehealth.value <= 0) {
    alert("You have won!")}
    }
    function dmg0() {
    var yh = document.form1.edmg0.value * 2;
    var yh0 = document.form1.yhealth.value
    document.form1.yhealth.value = yh0 - yh
    document.form1.hit0.disabled=true;
    document.form1.edmg.value = "";
    document.form1.edmg0.value = "";
    document.form1.hit.disabled=false
    spd0 = spd;
    if (document.form1.yhealth.value <= 0) {
    alert("You have lost.")};
    }
    </script>
    </head>
    <body onLoad="stats()">
    <form name="form1">
    Your Health:<br>
    <input type="text" name="yhealth" onfocus="document.form1.hit.focus()" size="12" value="500"><p>
    <input type="text" name="res" onfocus="document.form1.hit.focus()"size="2" value="">
    Roll to see if you will hit.<br>
    <input type="text" name="res0" onfocus="document.form1.hit.focus()" size="2" value="">
    You will deal this much damage.<br>
    <input type="button" name="put" value="Roll Dice" onClick="di()"><p>
    <input type="button" name="hit" value="Attack!" onClick="dmg()"><p><p>
    <hr width="25%" align="left">
    Enemy's Health:<br>
    <input type="text" name="foehealth" onfocus="document.form1.hit.focus()" size="12" value="500"><p>
    <input type="text" name="edmg" onfocus="document.form1.hit.focus()" size="2" value="">
    Roll to see if the enemy will hit you.<br>
    <input type="text" name="edmg0" onfocus="document.form1.hit.focus()" size="2" value="">
    The enemy will deal this much damage <b>two times</b>.<br>
    <input type="button" name="edi" value="Roll Dice" onClick="di0()"><p>
    <input type="button" name="hit0" value="Attack!" onClick="dmg0()">
    <body>
    </form>
    </form>
    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just a note that is relevant here only because of similarity in subject.

    Have you seen this? AFAIK, it's all DHTML. Pretty sweet.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    A 4D universe
    Posts
    1,337
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Pity they have no scrollbars at all... hrmm.
    http://www.mudsplat.com - Web design, print, and marketing solutions.

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Scrollbars in the other sections.

    Quaint

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey all,

    I'm presently working on a Javascript (pushing Jscript to it's absolute limits!) role playing game with a PHP/mySQL backend, and I am in need of an artist or artist(s) who are interested in making graphics for the game, including character & monster animations, as well as the game world. (I *suck* at grfx )

    The game features a scrolling 2d engine that can handle very large maps (largest i've tried is roughly 400x200 'moves'), seemless map-changes & world interaction, sound effects, seemless 'background' game saves without page reloads or play interuption. Some killer graphics would really do this game some justice.

    Also, if you have some ideas for the game, story, a dungeon or otherwise, don't be shy.

    If you're interested in helping with the game (NOT money :P), contact me at:

    dtw@elitefxgames.com
    or
    ICQ: 156498445
    AOLIM: Fitzbean4

    Thanks

  • #6
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    holy jesus, beetle that rpg is in Javascript???!!!?!?!? omg, crazy person who has toooo much time in there hands to script hundreds of pages of javascript. I cant believe that a game of that degree could be done in javascript, It would be superb for even full scale Java applet.
    Kris Hubby
    kwhubby site

  • #7
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hehe, ya, kinda hard to believe. Javascript is so commonly used for so many small and simple things, it's easy to overlook the fact that it's a pretty full programming language. I've recently forayed into OOP with javascript (not as easy to do as say, PHP) and I'm surprised at some of the things I can accomplish
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #8
    New Coder
    Join Date
    Jun 2002
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, it's coming along nicely. Basic monsters and AI is in, as well as items and such. Much of the engine ground work is in and working nicely.

    I'll supply private demos at this point to anyone interested in perhaps a little testing and such down the line.. thanks.
    Last edited by Fitzbean; 11-12-2002 at 07:30 AM.

  • #9
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    I am making a sortov simple game in javascript, sorta like super mario type 2d interface, and Im using div tags, and pictures to make it. But I never imagined that something in javascript, could be so solid and so full as that game. and 3d!! jesus. Only thing better that he could do would be to make a true 3d enviroment that renders the game in the perspective of the player.
    Kris Hubby
    kwhubby site

  • #10
    New Coder
    Join Date
    Jun 2002
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    3d? no one said anything about 3d

  • #11
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    I was talking to beetle about that other game by those japanese people
    Kris Hubby
    kwhubby site

  • #12
    New Coder
    Join Date
    Jun 2002
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah that one. Well, that's 2d as well, but isometric. Ala diablo style.

  • #13
    Regular Coder
    Join Date
    Nov 2002
    Location
    Carmel California
    Posts
    471
    Thanks
    0
    Thanked 1 Time in 1 Post
    a guestion, how do you make the picture scrol around in a frame or layer like that??(such as done the game by those japanese people, and yours)
    Kris Hubby
    kwhubby site

  • #14
    New Coder
    Join Date
    Jun 2002
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Don't know what exactly they did, but in my game it's basically a collection of images (that make up a map). As you move the character, the images shift up, down, left or right depending on what direction you press. As the row of images that is scrolling out of the viewable area goes off the screen, the new row is made visible on the oppisite side. All the images have an ID that I can then access the top and left properies via:

    document.images.tiletomove.top
    document.images.tiletomove.left

    of course it's a little more complicated than that, and each map cell has a variety of properies such as graphic to display, triggers, doors, blocked or not, etc. Objects and monsters are layered over the top of the map, with an id corresponding the the block they will start on. If it's a monster, and it moves, it's ID is adjusted to reflect the new location.
    Last edited by Fitzbean; 11-13-2002 at 01:26 AM.

  • #15
    Regular Coder
    Join Date
    Sep 2002
    Location
    Louisiana
    Posts
    576
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i upgraded the script almost entirely but then formatted and forgot to save, still no graphics but this game was just a mock up of a notebook game me and my friends have been playing. I knew stuff like that 3d rpg could be made in javascript, but that is just impressive!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •