|
Post by gamerboy251 on Jan 26, 2006 8:52:09 GMT -5
???I feel like such a idoit......Whats the best way for topdown movement?
|
|
|
Post by IsmAvatar on Jan 26, 2006 15:39:50 GMT -5
You're not an idiot, this is a good question, and oftentimes asked in a poll rather than for personal understanding.
There is no best movement method. It's mostly up to the programmer - how much control they wish to have over the player, how dummy-proof they want their game to be. When programming, I prefer 4-direction grid snap, because it gives me the most control over the player, ensuring that they don't get stuck or anything. When playing games, however, I prefer to have open-ended, 8-direction or 360 direction (360 is almost manditory for topdown shooters), because it makes me feel free in the game, and this freedom allows me to fully immerse myself in the game and the storyline.
If you need help programming a specific type of topdown movement, provide specific details of what type of movement you wish to have and what you have already tried.
|
|
|
Post by gamerboy251 on Jan 26, 2006 16:55:50 GMT -5
Yes unfortunatly i have trouble with making a grid based system for walking. Whatever i do my guys sprites allways get mesed up or something. Can you help.
|
|
|
Post by IsmAvatar on Jan 26, 2006 18:57:34 GMT -5
Yes, any one of us here can help you, but you're going to have to provide a little more detail than "my top-down grid RPG isn't working"
|
|
|
Post by evilish on Jan 26, 2006 21:05:33 GMT -5
The way I have a grid style system is like this.
You have a variable, something like 'move'. Anyway, move represents if your currently moving, so if you press a key, check what move is first.
Then, set the sprite to whatever direction and set it to whatever speed, set move to true and an alarm to (gridsize/speed). So if for example your travelling at 2 speed over a 16 grid size, the alarm would be 8(because thats how long it takes to get to the next grid spot)
Then, in the alarm event, set the speed back to zero, the sprite back to it's idle sprite or whatever, and move to false...
- Evilish
|
|
|
Post by IsmAvatar on Jan 27, 2006 11:10:24 GMT -5
Sounds like it would work. You'll need to provide more detail or maybe a few lines of code (just a few - the more important ones - not many people will be willing to pick through a 30 line code). Also take a look at my grid movement example(s) on my website. Examples include SnakeG, NPC Random Grid Movement, and Grid New Priorities Movement (script). Perhaps you can learn from these and/or use them (the script is mostly intended just to be used, since it's prolly a bit too complicated to understand)
|
|