Jump to content
MakeWebGames

Map RPG (Default Name)


Script47

Recommended Posts

Maybe bind keyboard keys for movement and space for attack? also have it so the log is always scrolled to the bottom ;)

That was the plan but it got too late lol so I went to bed. :p

 

I managed to walk into the red enemy and wasn't able to move back out again! Think your collision detection is broken.

The moment you touch the red enemy you will initiate combat, which stops you from moving until either one you die. I should probably put that in the log.

Link to comment
Share on other sites

$(document).keydown(function(e){
   if (e.keyCode == 37) { 
      moveLeft();
      return false;
   } else if (e.keyCode == 38) { 
      moveUp();
      return false;
   } else if (e.keyCode == 39) { 
      moveRight();
      return false;
   } else if (e.keyCode == 40) { 
      moveDown();
      return false;
   } 
});

Adding that made it much better to play

Link to comment
Share on other sites

I actually like this, I will probably get someone to make me something like this and implant it to my attack system.

But of course more advanced.

However great job i love it!

Thanks.

 

$(document).keydown(function(e){
   if (e.keyCode == 37) { 
      moveLeft();
      return false;
   } else if (e.keyCode == 38) { 
      moveUp();
      return false;
   } else if (e.keyCode == 39) { 
      moveRight();
      return false;
   } else if (e.keyCode == 40) { 
      moveDown();
      return false;
   } 
});

 

Adding that made it much better to play

Pfft, using jQuery when JavaScript could have done the job! :p

Key binds will be added in next update.

Adding graphics. :)

Edit: Question, shall I make the grass smoother?

[ATTACH=CONFIG]1572[/ATTACH]

194005986_MapRPG.thumb.png.0775d9dc641c3eed3d98169bf9884b34.png

Edited by Script47
Link to comment
Share on other sites

Thanks.

Pfft, using jQuery when JavaScript could have done the job! :p

Key binds will be added in next update.

Adding graphics. :)

Edit: Question, shall I make the grass smoother?

[ATTACH=CONFIG]1572[/ATTACH]

Im just so used to using JQuery i do it without thinking lol, It looks good so far, what about adding multiple bots on the map.

Link to comment
Share on other sites

Thanks.

Pfft, using jQuery when JavaScript could have done the job! :p

just want to say that keyCode is not supported by all browsers, in some browsers there are no keyCode at all

https://github.com/BlackScorp/tiled2crafty/blob/gh-pages/kinetic/js/libs/Keyboard.js#L116-L119

here is an crossbrowser version. you can use it like this

https://github.com/BlackScorp/tiled2crafty/blob/gh-pages/kinetic/js/game/game.js#L39-L47

and check if a key is down like this https://github.com/BlackScorp/tiled2crafty/blob/gh-pages/kinetic/js/game/game.js#L77

dont think jQuery is just a framework to easy select ond modify DOM elements, jquery also has many crossbrowser stuffs inside

Link to comment
Share on other sites

Aaaaaite new update.

New Version: Some Version Number here!

What this update includes?

Key binds

Improved attacking

Experience

Levels

Tutorial

http://maprpg.my-jsgames.tk/

You should make the sprite rotate to which direction you're travelling in and also make it so each move is equal to the size of the sprite, otherwise it looks like you're taking tiny baby steps.

I don't get why you're so against using something like jQuery for this. It just provides loads of cross compatibility functions to make sure your system is going to work in more browsers without having to do numerous weird work arounds. I also find it's a lot more legible then raw javascript.

Link to comment
Share on other sites

I just mean that I'm trying to keep the raw Javascript.

but if you want do this, you have to know each special stuffs for each browser and version, even the jQuery developer dont know all special cases since they fixed the bugs over the years. vanilla JS is nice, but will bring you a lot of trouble which ends up with using jQuery and drop your current code away, which will be wasted time at the end

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...