I need help with how I want the player to move. I want the movement of the game to be mouse based, i.e I want the player to jump up left when moving cursor to the left of the slime and jump up right when mouse is to the right of the slime. How would I be able to achive this? I've tried to test something if it'll work, and it didn't.
What I tried was
if stat(34)==1 and (on_ground or jump<2) and SX==8 and sy==8 and mouse.x<x then
on_ground=false
jump+=1
dy=dy-1
sfx(0)
end
This doesn't work since whenever the X cord for the mouse is less then the slime X, or x, it still jumps. Is there something I'm not thinking of that could work?
P#122970 2022-12-25 00:21 ( Edited 2022-12-25 00:22)
Well it could be cos() or sin(), @ooooggll. Yet that is not required.
A simple coefficient with gravity would work.
I'm headed to midnight mass right now but if no-one writes any code to demonstrate this principle I will do so on Christmas Day.
And - Happy Holidays everyone ! 🎄
P#122980 2022-12-25 02:50
[Please log in to post a comment]