H
HypSandar
Guest
Hello ツ
Here's the story:
[1] - Zombies spawning worked
[2] - Implemented changes, 30 ticks between spawns to polish it.
[3] - Zombies aren't spawning anymore
Here's the script:
Player
Bullet
Zombie
Spawner
Thanks in advance! I've been trying to fix this for 2 hours straight....
Here's the story:
[1] - Zombies spawning worked
[2] - Implemented changes, 30 ticks between spawns to polish it.
[3] - Zombies aren't spawning anymore
Here's the script:
Player
Code:
Information about object: obj_player
Sprite: Player
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:
//Variables
shooting=false;
health=100;
Alarm Event for alarm 0:
execute code:
shooting=false;
Step Event:
execute code:
image_angle = direction
image_angle = point_direction(x,y,mouse_x,mouse_y);
if keyboard_check(vk_right) && place_free(x+5,y) {x+=5}
if keyboard_check(vk_left) && place_free(x-5,y) {x-=5}
if keyboard_check(vk_up) && place_free(x,y-5) {y-=5}
if keyboard_check(vk_down) && place_free(x,y+5) {y+=5}
Mouse Event for Glob Left Button:
execute code:
if shooting=false
{
shooting=true
instance_create(x,y,obj_bullet)
alarm[0] = 30;
}
Bullet
Code:
Information about object: obj_bullet
Sprite: Bullet
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:
move_towards_point(mouse_x,mouse_y,15)
Zombie
Code:
Information about object: obj_zombie
Sprite: spr_zombie
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Step Event:
execute code:
image_angle = point_direction(x,y,obj_player.x,obj_player.y)
mp_potential_step(obj_player.x,obj_player.y,3,false)
Spawner
Code:
Information about object: obj_spawner
Sprite:
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:
spawn=true
Alarm Event for alarm 0:
execute code:
spawn=true
Step Event:
execute code:
//Floor means its a whole number, NOT "1.5415", instead just "1"
// Picks a number from 0 to 80
// If that number happens to be less than 1, it will create a zombie
if floor(random(80)) < 1 && spawn = true
{
instance_create(x,y,obj_zombie)
}
spawn=false
alarm[0]=30
Thanks in advance! I've been trying to fix this for 2 hours straight....
Last edited by a moderator: