Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
TobiSGD2816y@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).
-
lxmcf204106y@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 -
TobiSGD2816y@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.
-
lxmcf204106y@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
-
TobiSGD2816y@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.
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 👍
random