![]() ![]() PositionX += velocityX * time // Apply horizontal velocity to X position In particular, you need position, velocity, and gravity defined, and your update loop should be doing something roughly similar to this (collision detection and response omitted for simplicity): float positionX, positionY // Position of the characterįloat velocityX, velocityY // Velocity of the characterįloat gravity = 0.5f // How strong is gravity What I'll describe below is just one of the possibilities.įirst you need some basic physics variables and calculations on your update loop. Also, there are numerous ways to implement this, depending on a lot of factors. ![]() And although the underlying API might have some differences from DirectX, that has nothing to do with jumping, so the same tutorials or answers should apply here. First of all, XNA also uses C# too so it's the same programming language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |