Jump to content

Recommended Posts

Hello!

 

I am really new to Ajax, been reading and playing with some tutorials and what not, But I haven't been able to find what I've been wanting to do.

 

What I would like to be able to do is basically Walking on a map within the browser. Basically I want to move a little sprite across a image(map) when the arrow keys are pressed, and have certain parts of the image set as collision or un-walkable

 

I know this can be done, I've seen other Browser based games doing it. Just haven't been able to find any examples/tuts online

 

Any Sites/Tutorials/Hints/Tips are much appreciated  8)

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/209950-ajax-game-walking/
Share on other sites

I think you don't know what ajax is (yet). You don't even need it you can do it with javascript alone. You might want to consider using flash instead since it's specifically made for animations.

If you do want to go down the javascript road use a framework such as jQuery, mootools, prototype etc. It will make it a whole lot easier

Link to comment
https://forums.phpfreaks.com/topic/209950-ajax-game-walking/#findComment-1095900
Share on other sites

Ok, I went and Edumacated myself a little, and then started playing with Javascript. and I have gotten what I'm going for.

 

HERE

 

But I am stumped on, Borders..? Such as the Trees, Water, Bushes, Edges of the Raised terrain..

 

How would I make it not possible to move the sprite there?

Link to comment
https://forums.phpfreaks.com/topic/209950-ajax-game-walking/#findComment-1096764
Share on other sites

You could probably define areas in an array, have like a TOP X/Y and a BOTTOM X/Y, and all the tiles between the two are declared as obstructions. Then when moving your sprite make sure that the tile the sprite is going to move on is not in the obstructions array.

Link to comment
https://forums.phpfreaks.com/topic/209950-ajax-game-walking/#findComment-1096802
Share on other sites

add me to MSN I want to discuss me joining this project of yours :)

 

RussellonMSN@hotmail.com

 

Are you sure that couldn't have been sent via a PM? Hope your spam box is nice and roomy.

 

this email is always getting spammed, it makes me feel alive, thank you for the concern though thorpe :) I sent you a PM you never answered that 1 though :)

Link to comment
https://forums.phpfreaks.com/topic/209950-ajax-game-walking/#findComment-1096940
Share on other sites

This is a broad area of expertise. There are many things you must educate yourself on. Collision detection algorithms be one of the important ones. It's a very interesting topic and I wish you luck in your endeavor. I would say that you should research them as they will help you immensely while creating a game.

Link to comment
https://forums.phpfreaks.com/topic/209950-ajax-game-walking/#findComment-1099740
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.