Skip to content

Commit 20d603c

Browse files
committed
updated code
alpha, not release
1 parent 24bb02a commit 20d603c

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

objects/obj_game.object.gmx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ alarm[1] = 10;
144144
if(irandom(15 * add) = 1 && !paused) instance_create(960, irandom_range(90, 454), obj_coins);
145145

146146
//spawn heal
147-
if(irandom(110 * add) = 1 && !paused) instance_create(960, irandom_range(90, 454), obj_health);
147+
if(irandom(110 * add) = 1 && !paused && obj_player.hp < 95) instance_create(960, irandom_range(90, 454), obj_health);
148148

149149
//spawn enemy: orb
150150
if(irandom(24 * add) = 1 && !paused) instance_create(960, irandom_range(90, 454), obj_enemy_obs);
@@ -154,16 +154,12 @@ if(irandom(2) = 1 && !paused) instance_create(960, irandom_range(90, 454
154154

155155
//spawn mother ship
156156
if(irandom(180 * add) = 1 && !paused){
157-
if !(instance_exists(obj_mothership)){
158-
instance_create(1, irandom_range(90, 454), obj_mothership);
159-
}
157+
if !(instance_exists(obj_mothership)) instance_create(1, irandom_range(90, 454), obj_mothership);
160158
}
161159

162160
//spawn obstacle wall
163161
if(irandom(110 * add) = 1 && !paused && instance_exists(obj_player)){
164-
if !(instance_exists(obj_wall)){
165-
instance_create(958, irandom_range(90, 454), obj_wall);
166-
}
162+
if !(instance_exists(obj_wall)) instance_create(958, irandom_range(90, 454), obj_wall);
167163
}
168164

169165
//pause if start button pressed

objects/obj_player.object.gmx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ coin = 0;
5858
//variables
5959
y = clamp(y, 16, 528);
6060
image_angle = (vspeed / 5) * -45;
61+
hp = clamp(hp, -100, 100)
6162

6263
//controls using A/X button
6364
if(gamepad_button_check(0, gp_face1)) vspeed = -5 * boost;

objects/obj_wall.object.gmx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030
//var
3131
timer = 0;
3232
if(global.dif = 1){
33-
init_y = obj_player.y + irandom_range(50, 120);
33+
init_y = obj_player.y + irandom_range(-120, 120);
3434
wall_y_begin = init_y - irandom_range(10, 30);
3535
wall_y_end = init_y + irandom_range(10, 30);
3636
}
3737
else if(global.dif = 2){
38-
init_y = obj_player.y + irandom_range(0, 100);
38+
init_y = obj_player.y + irandom_range(-100, 100);
3939
wall_y_begin = init_y - irandom_range(10, 60);
4040
wall_y_end = init_y + irandom_range(10, 60);
4141
}
4242
else if(global.dif = 3){
43-
init_y = obj_player.y + irandom_range(0, 10);
43+
init_y = obj_player.y + irandom_range(-10, 10);
4444
wall_y_begin = init_y - irandom_range(10, 150);
4545
wall_y_end = init_y + irandom_range(10, 150);
4646
}
@@ -139,8 +139,8 @@ if(timer >= 10 && instance_exists(obj_player)){
139139

140140
//if player hit the wall
141141
if(obj_player.y >= wall_y_begin && obj_player.y <= wall_y_end){
142-
if(global.dif = 3) obj_player.hp -= 5;
143-
else obj_player.hp -= 2;
142+
if(global.dif = 2) obj_player.hp -= 2;
143+
else obj_player.hp -= 5;
144144

145145
if(instance_exists(obj_hitscreen)){
146146
if(!global.reduce){ obj_hitscreen.image_alpha = 1; obj_hitscreen.alarm[0] = 5;}

0 commit comments

Comments
 (0)