wrestitaway
Member
I have a player that uses ←↑↓→ arrows and a cursor that uses ASDW.
The cursor is persistent but does not come into play very often, so I would like to hide it by making it invisible when none of the ASDW keys are actively being pressed. I don't want to destroy/create it each time because I plan to have it hold information the player can use throughout the level even when they aren't using the cursor.
How would I make it visible only when active and have it "return" to a relative point inside the player's view when invisible?
Here's my basic movement so far for the cursor.
create:
step:
draw:
The player's view is view[0].
The cursor is persistent but does not come into play very often, so I would like to hide it by making it invisible when none of the ASDW keys are actively being pressed. I don't want to destroy/create it each time because I plan to have it hold information the player can use throughout the level even when they aren't using the cursor.
How would I make it visible only when active and have it "return" to a relative point inside the player's view when invisible?
Here's my basic movement so far for the cursor.
create:
GML:
movespeed = 2;
GML:
//inputs
c_left = keyboard_check(ord("A"))
c_right = keyboard_check(ord("D"))
c_down = keyboard_check(ord("S"))
c_up = keyboard_check(ord("W"))
///movement
hspeeds = (c_right - c_left) * movespeed;
vspeeds = (c_down - c_up) * movespeed;
//move cursor
x += hspeeds;
y += vspeeds;
GML:
draw_sprite(sp_cusor,0,x,y,)