www.webdeveloper.com
Results 1 to 3 of 3

Thread: [HELP] Dont know how to do this...

  1. #1
    Join Date
    Feb 2011
    Posts
    8

    [HELP] Dont know how to do this...

    Hi again, so i have an issue with my javascript, tile based web game. Actually a two issues, becouse of my lack of skills. So i want to ask few questions:

    1) I added a function which creates a block, like a map editor. But, i have a generated map already, so i am able to build blocks on the generated map too. And the thing is that the z-index'es are messed up. So when i build the block behind, it looks like its above... So how to calculate or how-to make it work in proper way?

    http://i53.tinypic.com/1z6v3nl.jpg

    2) How to make a colission detection between the player (div) and the tiles (divs) ? I got arrays with the X,Y pos of the tiles and arrays with the players X,Y pos. Can you put me on the right path?

    Thanks for help again, looking forward.

  2. #2
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    Do you want someone to write this code for you based on your photo?

  3. #3
    Join Date
    Feb 2011
    Posts
    8
    Quote Originally Posted by yamaharuss View Post
    Do you want someone to write this code for you based on your photo?
    Not really, all i want is just that you could put me on the right path of fixing this... Because, i dont really know how to. Anyways, would be great ofcourse, if someone could give me an example code which i could examine and try to use in my situation...

    Regards, looking forward.

    EDIT:

    i just realised, that i could check the Y position of the block and if that block Y > than the other blocks Y, i will make the z-index lower, so it would be behind. You think that would work ?
    Last edited by TheNewGuru; 02-05-2011 at 02:41 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles