Quantcast
Channel: Active questions tagged game-maker - Stack Overflow
Viewing all articles
Browse latest Browse all 180

is it acceptable to attach an action to a certain frame in a sprite? (Gamemaker)

$
0
0

So basically I'm making an attack mechanic where the player character charges in the direction of the mouse, but I want for there to be a slight input delay and I'm thinking about doing that by checking if the attacking sprite has reached a certain frame. Is this acceptable? Here's my code:

//attackingspeed = attackvelattackvel -= 0.1attackvel = clamp(attackvel,0,10)if attack and attackrecoil = false then{    direction = point_direction(x,y,mouse_x,mouse_y)    attackvel = 50    attackrecoil = true}

If this isn't efficient ill just use a timer but I don't really like using timers because I'm afraid they'll slow my game down.


Viewing all articles
Browse latest Browse all 180

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>