Hallo,
Ich hab schon wieder ein problem:
Ich möchte das der Spieler seine Waffen per Mausrad drehen kann(erstmal nebensächlich da ich denke der code schnipsel ist dafür richtig)
Mein Probolem ist wenn ich eine Waffe aufheb, werden beide events ausgelöst,also es wird aus den zwei pistolen geschossen(bei mausKlick)und aus der maschinen pistole gefeuert (bei mausDruck)deswegen hab ich variabeln eingefügt aber das klappt nicht,warum auch immer.
Hoffe ihr könnt helfen,danke im vorraus
Code:
Spoiler anzeigen
Alles anzeigen
Ich hab schon wieder ein problem:
Ich möchte das der Spieler seine Waffen per Mausrad drehen kann(erstmal nebensächlich da ich denke der code schnipsel ist dafür richtig)
Mein Probolem ist wenn ich eine Waffe aufheb, werden beide events ausgelöst,also es wird aus den zwei pistolen geschossen(bei mausKlick)und aus der maschinen pistole gefeuert (bei mausDruck)deswegen hab ich variabeln eingefügt aber das klappt nicht,warum auch immer.
Hoffe ihr könnt helfen,danke im vorraus
Code:
GML-Quellcode
- Create Event:
- execute code:
- image_speed = 0
- image_index = 0
- friction = 0.5
- shoot =0
- wp_mp = 0
- wp_dual = 1
- weapon = wp_dual
- Alarm Event for alarm 0:
- execute code:
- image_index = 0
- Alarm Event for alarm 1:
- execute code:
- shoot =0
- Step Event:
- execute code:
- if (keyboard_check(ord('W'))) {
- speed = 4
- }
- if (keyboard_check(ord('S'))) {
- speed = -4
- }
- if (mouse_check_button_pressed(mb_left)) && shoot = 0 {
- if weapon = wp_dual {
- if wp_dual = 1 {
- shoot =1
- image_index = 1
- instance_create(x+lengthdir_x(32,direction),y+lengthdir_y(26,direction),obj_bullet)
- instance_create(x+lengthdir_x(4,direction),y+lengthdir_y(26,direction),obj_bullet)
- alarm[0] = 2
- alarm[1] = 8
- }
- }
- }
- if (mouse_check_button(mb_left)) && shoot = 0 {
- if weapon = wp_mp {
- if wp_mp = 1 {
- shoot =1
- image_index = 1
- instance_create(x+lengthdir_x(28,direction),y+lengthdir_y(26,direction),obj_bullet)
- alarm[0] = 1
- alarm[1] = 5
- }
- }
- }
- execute code:
- direction = point_direction(x,y,mouse_x,mouse_y)
- image_angle = direction
- Collision Event with object obj_block:
- execute code:
- move_contact_solid(direction-90,1)
- Collision Event with object obj_weapon_mp:
- execute code:
- wp_mp = 1
- Mouse Event for Mouse Wheel Up:
- execute code:
- if weapon = wp_dual {
- weapon = wp_mp
- }else{
- weapon = wp_dual
- }
- Mouse Event for Mouse Wheel Down:
- execute code:
- if weapon = wp_dual {
- weapon = wp_mp
- }else{
- weapon = wp_dual
- }
Ich hab keine Ahnung