Okay, first things first…
IDK Why Dropbox says file is deleted. I’ll leave a link to the folder instead to circunvent this. let’s hope it’ll be enough…
The angle detection is fixed. turns out it was a logical issue.
The program needed to check for either variable to be true, not both… took me a bit to realize that, but the fix was easy peasy cuz I already knew how to add that.
With that out of the way, a few things still stand of my way of a clean start.
First of all,
By far the one thing that’s bugging me the most atm. the angle at 0… is not straightforward.
Ironically, however… 180 seems to be working just fine?
Feel free to check it out yourselves on the file. it’s much better to see how inclined the angle 0 is than in the screenshot.
Pixels are clearly not scaling properly… I’m not sure how to fix that…
Blurry text… how can I make it scale proportionally and with no antialiasing?
@Archezuli, I realise I’ve jumped into the converasation a bit late, but I think there may be a much easier way to achieve what you’re after without the use of trigonometry:
Rotate your player towards the mouse pointer is using the Player’s action “Rotate Toward Position”
The get the angle of the player with Player.Angle()
Use that angle to determine the sprite to display.
If you do it right, you can set each animation so that it matches the angle divided by 22.5 (360 degrees in 16 parts). The all you need to do is rotate the player, and set the animation number = round(angle/22.5).
2, possibly 3, lines of code. Quick and simple.
@MrMen Thank you for this! Brilliant idea!
I thought of something similar myself, but I thought in my head it wouldn’t work out because of the sprite constantly flipping between the rotated and non-rotated state… and admittedly didn’t try… so thank you! I have added it to the programming with full success.
I’m still gonna add the second part (Using the angle to tell which sprite the game should display, as slash suggested before.), but I still want to fix those aforementioned issues before that. Hopefully you guys can still help me out?