diff --git a/Platform Game.gmx/Platform Game.project.gmx b/Platform Game.gmx/Platform Game.project.gmx index 642c021..b9fd600 100644 --- a/Platform Game.gmx/Platform Game.project.gmx +++ b/Platform Game.gmx/Platform Game.project.gmx @@ -38,6 +38,7 @@ sprites\spr_spikebounds sprites\spr_text sprites\spr_next_level + sprites\spr_platformbounds sprites\spr_redflaglimp sprites\spr_redflagwaving @@ -104,6 +105,9 @@ sprites\spr_fadingblock sprites\spr_key sprites\spr_doorlocked + sprites\spr_platform + sprites\spr_horplatform + sprites\spr_verplatform sprites\spr_spikeblockhl @@ -138,6 +142,7 @@ sprites\spr_blockflashing sprites\spr_blockfrozen + sprites\sprite80 background\bg_sky @@ -164,6 +169,7 @@ objects\obj_text objects\obj_next_level objects\obj_pause_menu_controller + objects\obj_platformbound objects\obj_player @@ -183,6 +189,8 @@ objects\obj_fadingblock objects\obj_goldkey objects\obj_doorlocked + objects\obj_platform + objects\obj_horplatform objects\obj_spikeblockvd @@ -219,10 +227,9 @@ rooms\rm_initialize - rooms\rm_level01 - 41894.9807427778 + 41901.9844195139 '1.0.0.1' diff --git a/Platform Game.gmx/objects/obj_horplatform.object.gmx b/Platform Game.gmx/objects/obj_horplatform.object.gmx new file mode 100644 index 0000000..85913d3 --- /dev/null +++ b/Platform Game.gmx/objects/obj_horplatform.object.gmx @@ -0,0 +1,104 @@ + + + spr_horplatform + -1 + -1 + 0 + 0 + obj_platform + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + sprite_index = -1; +dir = -1; +movespeed = 3; +hsp = 0; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + mask_index = spr_horplatform; + +hsp = dir * movespeed; + +if (place_meeting(x+hsp,y,obj_platformbound)) +{ + while(!place_meeting(x+sign(hsp),y, obj_collision)) + { + x += sign(hsp); + } + hsp = 0; + dir *= -1; +} +x += hsp; + +if (instance_exists(obj_player)) +{ +if (round(obj_player.y + (obj_player.sprite_height/2)) > y) || (obj_player.key_down) mask_index = -1; + +else +{ + mask_index = spr_platform; + if place_meeting(x, y-1, obj_player) + { + obj_player.hsp_carry = hsp; + } + +} +} + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + 105,22 + 105,105 + + diff --git a/Platform Game.gmx/objects/obj_platform.object.gmx b/Platform Game.gmx/objects/obj_platform.object.gmx new file mode 100644 index 0000000..5dd497d --- /dev/null +++ b/Platform Game.gmx/objects/obj_platform.object.gmx @@ -0,0 +1,104 @@ + + + spr_platform + -1 + -1 + 0 + 0 + obj_collision + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + sprite_index = -1; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + if (instance_exists(obj_player)) +{ +if (round(obj_player.y + (obj_player.sprite_height/2)) > y) || (obj_player.key_down) mask_index = -1; + +else mask_index = spr_platform; + + + +} + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + draw_sprite(spr_platform,0,x,y); + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + 0,0 + 16,16 + + diff --git a/Platform Game.gmx/objects/obj_platformbound.object.gmx b/Platform Game.gmx/objects/obj_platformbound.object.gmx new file mode 100644 index 0000000..834f771 --- /dev/null +++ b/Platform Game.gmx/objects/obj_platformbound.object.gmx @@ -0,0 +1,26 @@ + + + spr_platformbounds + 0 + 0 + 0 + 0 + obj_collision + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + 35,35 + 35,35 + + diff --git a/Platform Game.gmx/objects/obj_player.object.gmx b/Platform Game.gmx/objects/obj_player.object.gmx index 079df58..cfed84d 100644 --- a/Platform Game.gmx/objects/obj_player.object.gmx +++ b/Platform Game.gmx/objects/obj_player.object.gmx @@ -39,6 +39,8 @@ instance_create(x,y,obj_controller); invincible = false; +key_down = 0;// for platform + abilitystate = 0; previousstate = 0; transition = false; @@ -60,6 +62,8 @@ atwatersurface = false; //Physics Variables grav = 1; hsp = 0; +hsp_carry = 0; +vsp_carry = 0; vsp = 0; jumpspeed = 25; movespeed = 8; @@ -1174,6 +1178,34 @@ if collision_spikeblockhr && obj_controller.gameover = false { obj_controller.gameover = true; } + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Collision with spikeblockvd + +collision_spikeblockvd = instance_place(x,y,obj_spikeblockvd) + +if collision_spikeblockvd && obj_controller.gameover = false +{ + obj_controller.gameover = true; +} @@ -1222,14 +1254,47 @@ if collision_spikeblockvu && obj_controller.gameover = false 1 - ///Collision with spikeblockvd + ///Collision with horplatform -collision_spikeblockvd = instance_place(x,y,obj_spikeblockvd) -if collision_spikeblockvd && obj_controller.gameover = false +var hsp_final = hsp + hsp_carry; +//var vsp_final = vsp + vsp_carry; +hsp_carry = 0; +//vsp_carry = 0; + +//Vertical Collision +if (place_meeting(x+hsp_final, y, obj_platform)) { - obj_controller.gameover = true; + while (!place_meeting(x+ sign(hsp_final), y, obj_platform)) + { + x += sign(hsp_final); + //y += sign(vsp_final); + } + hsp_final = 0; + //vsp_final = 0; + hsp = 0; + //vsp = 0; + } + +x += hsp_final; +//y += vsp_final; +/*//hsp_carry = 0; +var hsp_final = hsp + hsp_carry; +hsp_carry = 0; + +//Horizontal Collision +if (place_meeting(x+hsp_final, y, obj_horplatform)) +{ + while (!place_meeting(x+sign(hsp_final),y,obj_horplatform)) + { + x += sign(hsp_final); + } + hsp_final = 0; + hsp = 0; + //+sign(vsp_final } + +x += hsp_final;*/ @@ -1250,7 +1315,15 @@ if collision_spikeblockvd && obj_controller.gameover = false 1 - + ///Check for platform + +key_down = keyboard_check(vk_down); + +if (place_meeting(x, y+1, obj_platform)) +{ + if (input_jump) vsp = -jumpspeed; +} + diff --git a/Platform Game.gmx/objects/obj_verplatform.object.gmx b/Platform Game.gmx/objects/obj_verplatform.object.gmx new file mode 100644 index 0000000..44b8e8a --- /dev/null +++ b/Platform Game.gmx/objects/obj_verplatform.object.gmx @@ -0,0 +1,104 @@ + + + spr_verplatform + -1 + -1 + 0 + 0 + obj_platform + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + sprite_index = -1; +dir = 1; +movespeed = 3; +vsp = 0; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + mask_index = spr_verplatform; + +vsp = dir * movespeed; + +if (place_meeting(x,y+vsp,obj_platformbound)) +{ + while(!place_meeting(x,y+sign(vsp), obj_collision)) + { + y += sign(vsp); + } + vsp = 0; + dir *= -1; +} +y += vsp; + +if (instance_exists(obj_player)) +{ +if (round(obj_player.y + (obj_player.sprite_height/2)) > y) || (obj_player.key_down) mask_index = -1; + +else +{ + mask_index = spr_platform; + if place_meeting(x, y-1, obj_player) + { + obj_player.vsp_carry = vsp; + } + +} +} + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + 105,22 + 105,105 + + diff --git a/Platform Game.gmx/objects/object50.object.gmx b/Platform Game.gmx/objects/object50.object.gmx new file mode 100644 index 0000000..eeed8ac --- /dev/null +++ b/Platform Game.gmx/objects/object50.object.gmx @@ -0,0 +1,23 @@ + + + <undefined> + 0 + -1 + 0 + 0 + <undefined> + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/Platform Game.gmx/objects/object52.object.gmx b/Platform Game.gmx/objects/object52.object.gmx new file mode 100644 index 0000000..eeed8ac --- /dev/null +++ b/Platform Game.gmx/objects/object52.object.gmx @@ -0,0 +1,23 @@ + + + <undefined> + 0 + -1 + 0 + 0 + <undefined> + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/Platform Game.gmx/objects/object54.object.gmx b/Platform Game.gmx/objects/object54.object.gmx new file mode 100644 index 0000000..e7fe7a1 --- /dev/null +++ b/Platform Game.gmx/objects/object54.object.gmx @@ -0,0 +1,23 @@ + + + spr_platformbounds + -1 + 0 + 0 + 0 + obj_enemybounds + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/Platform Game.gmx/rooms/rm_level01.room.gmx b/Platform Game.gmx/rooms/rm_level01.room.gmx deleted file mode 100644 index c0c3d09..0000000 --- a/Platform Game.gmx/rooms/rm_level01.room.gmx +++ /dev/null @@ -1,92 +0,0 @@ - - - - 8400 - 3500 - 35 - 35 - 0 - 60 - 0 - 12632256 - -1 - - -1 - -1 - -1 - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 0 - 0 - 1024 - 768 - 0 - 10 - 0.100000001490116 - diff --git a/Platform Game.gmx/sprites/images/spr_horplatform_0.png b/Platform Game.gmx/sprites/images/spr_horplatform_0.png new file mode 100644 index 0000000..ac32b16 Binary files /dev/null and b/Platform Game.gmx/sprites/images/spr_horplatform_0.png differ diff --git a/Platform Game.gmx/sprites/images/spr_moveplatform_0.png b/Platform Game.gmx/sprites/images/spr_moveplatform_0.png new file mode 100644 index 0000000..faa8ccc Binary files /dev/null and b/Platform Game.gmx/sprites/images/spr_moveplatform_0.png differ diff --git a/Platform Game.gmx/sprites/images/spr_platform_0.png b/Platform Game.gmx/sprites/images/spr_platform_0.png new file mode 100644 index 0000000..faa8ccc Binary files /dev/null and b/Platform Game.gmx/sprites/images/spr_platform_0.png differ diff --git a/Platform Game.gmx/sprites/images/spr_platformbounds_0.png b/Platform Game.gmx/sprites/images/spr_platformbounds_0.png new file mode 100644 index 0000000..8e67562 Binary files /dev/null and b/Platform Game.gmx/sprites/images/spr_platformbounds_0.png differ diff --git a/Platform Game.gmx/sprites/images/spr_verplatform_0.png b/Platform Game.gmx/sprites/images/spr_verplatform_0.png new file mode 100644 index 0000000..ac32b16 Binary files /dev/null and b/Platform Game.gmx/sprites/images/spr_verplatform_0.png differ diff --git a/Platform Game.gmx/sprites/spr_horplatform.sprite.gmx b/Platform Game.gmx/sprites/spr_horplatform.sprite.gmx new file mode 100644 index 0000000..9d5b7ef --- /dev/null +++ b/Platform Game.gmx/sprites/spr_horplatform.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 105 + 22 + 1 + 0 + 0 + 0 + 0 + 209 + 0 + 44 + 0 + 0 + + 0 + + 0 + 210 + 70 + + images\spr_horplatform_0.png + + diff --git a/Platform Game.gmx/sprites/spr_platform.sprite.gmx b/Platform Game.gmx/sprites/spr_platform.sprite.gmx new file mode 100644 index 0000000..60e6b00 --- /dev/null +++ b/Platform Game.gmx/sprites/spr_platform.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 105 + 22 + 1 + 0 + 0 + 0 + 0 + 209 + 0 + 44 + 0 + 0 + + 0 + + 0 + 210 + 70 + + images\spr_platform_0.png + + diff --git a/Platform Game.gmx/sprites/spr_platformbounds.sprite.gmx b/Platform Game.gmx/sprites/spr_platformbounds.sprite.gmx new file mode 100644 index 0000000..2009b44 --- /dev/null +++ b/Platform Game.gmx/sprites/spr_platformbounds.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 35 + 35 + 1 + 0 + 0 + 0 + 0 + 69 + 0 + 69 + 0 + 0 + + 0 + + 0 + 70 + 70 + + images\spr_platformbounds_0.png + + diff --git a/Platform Game.gmx/sprites/spr_verplatform.sprite.gmx b/Platform Game.gmx/sprites/spr_verplatform.sprite.gmx new file mode 100644 index 0000000..58f9b04 --- /dev/null +++ b/Platform Game.gmx/sprites/spr_verplatform.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 105 + 22 + 1 + 0 + 0 + 0 + 0 + 209 + 0 + 44 + 0 + 0 + + 0 + + 0 + 210 + 70 + + images\spr_verplatform_0.png + + diff --git a/Platform Game.gmx/sprites/sprite80.sprite.gmx b/Platform Game.gmx/sprites/sprite80.sprite.gmx new file mode 100644 index 0000000..e9127f2 --- /dev/null +++ b/Platform Game.gmx/sprites/sprite80.sprite.gmx @@ -0,0 +1,23 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + 0 + + 0 + 32 + 32 + + diff --git a/hzhang91test.txt b/hzhang91test.txt new file mode 100644 index 0000000..e69de29