Hallo !
Habe hier ein kleines Problem. Shoot`n Run in GM 6 , Hauptcharakter kann springen, laufen, alles wunderbar, aber nur nach rechts
schiessen. Wie stelle ich es an, das er auch nach links schiesst, wenn
er nach links geht ? Optimal wäre noch eine Version, in der er diagonal
nach oben und unten schiessen könnte. Vielen Dank im Voraus für Eure Bemühungen ! Hier die Information:
Information about object: player_f
Sprite: right
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>
Create Event:
set variable can_shoot to 1
Alarm Event for alarm 0:
set variable can_shoot to 1
Step Event:
if relative position (0,1) is collision free for Only solid objects
set the gravity to 0.5 in direction 270
else
set the gravity to 0 in direction 270
if vspeed is larger than 12
set variable vspeed to 12
Collision Event with object blocker:
move in direction direction at most 12 till a contact with solid objects
set the vertical speed to 0
Collision Event with object virus5:
play sound sound0; looping: false
Keyboard Event for <Space> Key:
if can_shoot is equal to 1
create instance of object object18 at relative position (0,0)
play sound sound1; looping: false
set variable can_shoot to 0
set Alarm 0 to 15
Keyboard Event for <Left> Key:
if relative position (-4,0) is collision free for Only solid objects
move relative to position (-4,0)
set the sprite to left with subimage 0 and speed 1
Keyboard Event for <Up> Key:
if relative position (0,1) gives a collision with Only solid objects
set the vertical speed to -10
Keyboard Event for <Right> Key:
if relative position (4,0) is collision free for Only solid objects
move relative to position (4,0)
set the sprite to right with subimage 0 and speed 1
Habe hier ein kleines Problem. Shoot`n Run in GM 6 , Hauptcharakter kann springen, laufen, alles wunderbar, aber nur nach rechts
schiessen. Wie stelle ich es an, das er auch nach links schiesst, wenn
er nach links geht ? Optimal wäre noch eine Version, in der er diagonal
nach oben und unten schiessen könnte. Vielen Dank im Voraus für Eure Bemühungen ! Hier die Information:
Information about object: player_f
Sprite: right
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>
Create Event:
set variable can_shoot to 1
Alarm Event for alarm 0:
set variable can_shoot to 1
Step Event:
if relative position (0,1) is collision free for Only solid objects
set the gravity to 0.5 in direction 270
else
set the gravity to 0 in direction 270
if vspeed is larger than 12
set variable vspeed to 12
Collision Event with object blocker:
move in direction direction at most 12 till a contact with solid objects
set the vertical speed to 0
Collision Event with object virus5:
play sound sound0; looping: false
Keyboard Event for <Space> Key:
if can_shoot is equal to 1
create instance of object object18 at relative position (0,0)
play sound sound1; looping: false
set variable can_shoot to 0
set Alarm 0 to 15
Keyboard Event for <Left> Key:
if relative position (-4,0) is collision free for Only solid objects
move relative to position (-4,0)
set the sprite to left with subimage 0 and speed 1
Keyboard Event for <Up> Key:
if relative position (0,1) gives a collision with Only solid objects
set the vertical speed to -10
Keyboard Event for <Right> Key:
if relative position (4,0) is collision free for Only solid objects
move relative to position (4,0)
set the sprite to right with subimage 0 and speed 1