Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- obj_player:
- Step:
- image_xscale = obj_player_arm.image_yscale
- Keyboard Left:
- x -= 3
- Keyboard right:
- x += 3
- obj_player_arm:
- Step:
- direction=point_direction(x,y,mouse_x,mouse_y)
- image_angle=direction
- x= obj_player.x
- y= obj_player.y
- if direction>270
- {
- image_yscale=1
- }
- if direction<=90
- {
- image_yscale=1
- }
- if direction>90 and direction<=270
- {
- image_yscale=-1
- }
- //this is the main code
- //
- //it tells the sprite to flip on the y axis when it reaches a cretain direction
- Global Left Pressed:
- instance_create(x,y,obj_bullet)
- Draw:
- draw_sprite_ext(sprite_index,image_index,obj_player.x,obj_player.y,image_xscale,image_yscale,image_angle,c_white,1)
- obj_bullet:
- move_towards_point(mouse_x,mouse_y,10)
Advertisement
Add Comment
Please, Sign In to add comment