Yes, I guess it's subpixel-based like Mario.qbradq wrote:So I'm not going to read 52 pages back I assume from the few pages I've caught up on this is not cell-based (like Zelda II's overworld), but subpixel-based (like Mario).
Ok, thank you qbradq!qbradq wrote:Typically I use a velocity variable for every object. So in the above code snippet I would set the player's X velocity value to some value. Then during the object update routine I apply the velocity to the position, then check for collisions, and if there is a collision react to it. If you do go this route, do Y movement and collision detection first, then X. Trust me on that one
YES! Thank you so very much qbradq!qbradq wrote:Also, sounds like you've got good parents and a pretty awesome sister
Thank you very much tokumaru!tokumaru wrote:Controller input shouldn't directly affect the horizontal position of the player. Instead, it should affect the horizontal velocity (just like gravity affects its vertical velocity), and the velocity, whatever it is, should be added to the player's position every frame (again, like happens with vertical movement).
If a direction is pressed, increase velocity in that direction, if no direction is pressed, gradually decrease the velocity until it reaches 0 (this creates a nice inertia effect). After adding the velocity variable to the current position, check whether the block(s) at the edge of the player in the direction of the movement are solid, in which case you need to push the character back, like we discussed before.
Ejecting from the right should be exactly same as repelling from the ground, while the formula for ejecting from the left or from the ceiling is a bit different, but I'm sure you'll figure it out.
I have metroid but have not played it much. Though, I do remember the great platforming it has; it has jumps as in Mario.qbradq wrote:Yea, platformer physics can be painful at times.
So OP, here's a list of games off the top of my head you can look at that do it right:
Zelda II: Adventure of Link, The
Super Mario Bro.s
Super Mario Bro.s 3
I have CV1 and MM3 and Ghosts 'n Goblins. Castlevania is interesting... but I don't see how it does very poorly. I'm hoping you will explain what you mean by that. I'm eager to learn!qbradq wrote:And here's a few that do it very poorly:
EVERY Castlevania game, but especially CV1
Most Mega Man games, especially MM1
Any Donkey Kong game
Ghosts 'n Goblins
I spent some time last night looking up velocity in my Physics textbook. Velocity is speed/time, right? I'm going to look up inertia tomorrow.