Jump to content

Managing map/obstacles on browser-game? NOOB!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
by0logic

by0logic

    Newbie

  • Members
  • PipPip
  • 19 posts
Hey guys, I'm trying to get more serious into programming so I've started my first browser game project. Right now I'm working on a Diablo 1 ripoff just to see what I can and can't do. I've ran into a problem and I'd like your opinion on the easiest way to manage a map and its obstacles (wall/houses,stones,etc).

I started using z-layers to get the character and obstacles over the game background and move stuff accordingly but how do I keep my character from running through a wall?

Should I start using some kind of grid? Should I figure something to implement coords and preset 'obstacle' zones in a databank I then verify everytime my character coords attempt to move? Am I stupid?:confused:

Basically, I know my way is wrong but that's all I could think of.
I don't expect anyone to do miracle with this kind of thread/post but if anyone has suggestions or ideas on how to go, I'd really appreciate.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Are you treating walls as part of the background, or at the same level as the player?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
by0logic

by0logic

    Newbie

  • Members
  • PipPip
  • 19 posts
Right now the obstacles are on the same level than the character but i can change that. Im also considering using many zlayers for the obstacles so i can try to figure the "deepness" tho i dont know how ill do that yet so maybe i wont.