9
lxmcf
6y

Got bored and started work on a basic 2D game engine using vala and GTK to provide basic windows and UI...

If I can get a sprite moving on screen with at least 8 axis of movement I'll consider it a job done and throw her on GitHub and probably never touch again 👍

Comments
  • 0
    2D, 8 axis of movement. Wut?
  • 0
    @Gregozor2121 up, down, left, right and 1 middle point between each axis
  • 1
    @lxmcf up and down is the same axis, left and right is the same axis, all other movements are just movements on these two combined. You might want to use scaling to get a virtual 3rd axis (front/back).
  • 0
    @TobiSGD yes but I do movement where the axis' have a value of -1, 0 and 1 which gives me the 8 directions of movement...

    Probably should have said 8 directional movement instead now that I think about it
  • 0
    @lxmcf I would abandon the notion of having 8 directions you can move to. Just handle your directions as a Vector2 and you can have infinite directions and it isn't hard to implememnt that.
  • 0
    @TobiSGD yes but on a mouse and keyboard it's kind of hard to get 360 degrees of motion so I would need to add controller support and at that point it becomes a more serious project instead of me just giving around with vala
  • 1
    @lxmcf I think you misunderstood me. You don't have to implement controller support, you can use the Vector2 solution just fine with limiting yourself to just 8 directions by setting up your movement-Vector so that your elements only move in 45° angles.
    But this way your engine is already prepared to get controller support, or, since you speak of mouse support, just move the element in that direction the user has clicked.
  • 0
    @TobiSGD actually yeah good point
Add Comment