Devlog #1.3: Let there be Movement!
Hey everyone! In this devlog, I added movement to our game engine: Olympus!
New functions!
I created two new functions: btn() and btnp().
btn() is for when the key on your keyboard will be held down. This can be used for movement.
btnp() is for when the key is only going to be pressed once. This can be used for actions such as jumping, shooting, or confirming something in the game.
How does the movement work?
An objects position is two variables: px and py. px is the x-axis (left and right) and py is the y-axis (up and down). If you remember from algebra, when you subtract your initial position in the x-axis, you move to the left and when you add your initial position in the x-axis, you move right. The same applys for the y-axis. If you subtract, you move down. If you add, you go up. So, we check the keys using the btn() function. So, if btn(LEFT) == True when the left arrow is held, it will subtract from px on whatever value you want and it will move the character that way.
What’s next?
That’s it for today’s devlog. Tomorrow, I hope to finally implement sprites into the game, so you can add custom models instead of using just circles and squares. See you later!
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.