From 63ada3dd330db7d9f8db2667e138d8dbf0a0be30 Mon Sep 17 00:00:00 2001 From: SilicaAndPina Date: Wed, 9 Sep 2020 11:53:46 +1200 Subject: [PATCH] add broken ships --- Spaceinator.project.gmx | 7 +- objects/obj_broken_ship.object.gmx | 155 ++++++++++++++++++ objects/obj_bullet.object.gmx | 25 +++ objects/obj_chunk.object.gmx | 17 +- objects/obj_controller.object.gmx | 53 +++++- objects/obj_player.object.gmx | 36 +++- sprites/images/s_0.png | Bin 0 -> 209 bytes sprites/images/spr_blocks_2.png | Bin 0 -> 904 bytes sprites/images/spr_broken_ship_0.png | Bin 0 -> 327 bytes sprites/images/spr_crafting_0.png | Bin 0 -> 781 bytes sprites/images/spr_final_0.png | Bin 0 -> 155 bytes sprites/images/spr_intentory_0.png | Bin 2772 -> 2771 bytes sprites/spr_blocks.sprite.gmx | 1 + ....sprite.gmx => spr_broken_ship.sprite.gmx} | 2 +- sprites/spr_crafting.sprite.gmx | 25 +++ sprites/spr_final.sprite.gmx | 25 +++ 16 files changed, 330 insertions(+), 16 deletions(-) create mode 100644 objects/obj_broken_ship.object.gmx create mode 100644 sprites/images/s_0.png create mode 100644 sprites/images/spr_blocks_2.png create mode 100644 sprites/images/spr_broken_ship_0.png create mode 100644 sprites/images/spr_crafting_0.png create mode 100644 sprites/images/spr_final_0.png rename sprites/{spr_enemy.sprite.gmx => spr_broken_ship.sprite.gmx} (91%) create mode 100644 sprites/spr_crafting.sprite.gmx create mode 100644 sprites/spr_final.sprite.gmx diff --git a/Spaceinator.project.gmx b/Spaceinator.project.gmx index 1ea62eb..5375ec3 100644 --- a/Spaceinator.project.gmx +++ b/Spaceinator.project.gmx @@ -14,7 +14,7 @@ sprites\spr_bullets sprites\spr_blocks sprites\spr_blackhole - sprites\spr_enemy + sprites\spr_broken_ship sprites\spr_asteroid sprites\spr_boom sprites\spr_chunk @@ -23,6 +23,7 @@ sprites\spr_button sprites\spr_hotbar sprites\spr_intentory + sprites\s @@ -41,6 +42,7 @@ objects\obj_asteriod + objects\obj_broken_ship objects\obj_chunk_item objects\obj_black_hole @@ -69,11 +71,12 @@ rooms\rm_title rooms\rm_game - + 32 16 0 1 + 2 help.rtf diff --git a/objects/obj_broken_ship.object.gmx b/objects/obj_broken_ship.object.gmx new file mode 100644 index 0000000..1a986b3 --- /dev/null +++ b/objects/obj_broken_ship.object.gmx @@ -0,0 +1,155 @@ + + + spr_broken_ship + 0 + -1 + 0 + 0 + obj_chunk_item + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + /// Init +image_speed = 0; +image_index = 0; +angle = random_range(0,180); +direction = angle; +image_angle = angle; + + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + with(instance_create(x,y,obj_dropped_item)) +{ + item_id = METAL; +} + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + /// Slow down if too fast +if(speed > 0) +{ + speed -= 1 +} + + +pull_towards_black_holes(); + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + speed = -20; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + instance_destroy(id); + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/obj_bullet.object.gmx b/objects/obj_bullet.object.gmx index 9c9f3ae..3da98d7 100644 --- a/objects/obj_bullet.object.gmx +++ b/objects/obj_bullet.object.gmx @@ -57,6 +57,31 @@ if(step_counter == 60*room_speed || instance_position(x,y,obj_chunk) == noone) { instance_destroy(self); } + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + instance_destroy(other); +instance_create(other.x,other.y,obj_boom_fx) +instance_destroy(id); diff --git a/objects/obj_chunk.object.gmx b/objects/obj_chunk.object.gmx index 9da5575..73072d3 100644 --- a/objects/obj_chunk.object.gmx +++ b/objects/obj_chunk.object.gmx @@ -29,15 +29,26 @@ instance_list = ds_list_create(); loaded = true; var hasGeneratedBlackHole = false; +var hasGeneratedBrokenShip = false; // GENERATION for(var xx = 0; xx < CHUNK_SIZE*TILE_SIZE; xx+= TILE_SIZE) { for(var yy = 0; yy < CHUNK_SIZE*TILE_SIZE; yy+= TILE_SIZE) { - var rnd = random_range(0,5000); - - if(floor(rnd) == 1000) + var rnd = random_range(0,10000); + if(floor(rnd % 10000) == 8103) + { + if(hasGeneratedBrokenShip) + continue; + var inst = instance_create(x+xx,y+yy, obj_broken_ship); + inst.CHUNK_CONTAINED = self.id; + ds_list_add(instance_list, inst); + + hasGeneratedBrokenShip = true; + continue; + } + if(floor(rnd % 5000) == 1000) { if(hasGeneratedBlackHole) continue; diff --git a/objects/obj_controller.object.gmx b/objects/obj_controller.object.gmx index 3225f6d..c6da8cf 100644 --- a/objects/obj_controller.object.gmx +++ b/objects/obj_controller.object.gmx @@ -26,6 +26,7 @@ 1 global.debug = false +global.hide = false; @@ -50,15 +51,17 @@ 1 /// Draw HUD -if(!global.debug) -{ - draw_set_color(c_white); - draw_healthbar(10,10,500,30,(obj_player.energy/obj_player.energy_max)*100,c_gray,c_blue,c_navy,0,true,false); - draw_text(11,13,string(obj_player.energy)+" / "+string(obj_player.energy_max)); - - draw_healthbar(10,40,300,60,(obj_player.hp/obj_player.hp_max)*100,c_gray,c_red,c_green,0,true,false); - draw_text(11,43,string(obj_player.hp)+" / "+string(obj_player.hp_max)); - +if(!global.hide){ + if(!global.debug) + { + draw_set_color(c_white); + draw_healthbar(10,10,500,30,(obj_player.energy/obj_player.energy_max)*100,c_gray,c_blue,c_navy,0,true,false); + draw_text(11,13,string(obj_player.energy)+" / "+string(obj_player.energy_max)); + + draw_healthbar(10,40,300,60,(obj_player.hp/obj_player.hp_max)*100,c_gray,c_red,c_green,0,true,false); + draw_text(11,43,string(obj_player.hp)+" / "+string(obj_player.hp_max)); + + } } @@ -184,6 +187,38 @@ else { global.debug = false } + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + if(!global.hide) +{ + global.hide = true; + instance_destroy(obj_hotbar); +} +else +{ + global.hide = false + instance_create(0,0,obj_hotbar); +} diff --git a/objects/obj_player.object.gmx b/objects/obj_player.object.gmx index 52ed596..0307686 100644 --- a/objects/obj_player.object.gmx +++ b/objects/obj_player.object.gmx @@ -96,7 +96,7 @@ if(speed > 0) speed -= 1 } -if(energy >= 10 && is_moving && keyboard_check(vk_shift)) +if((energy >= 10 && is_moving && keyboard_check(vk_shift)) || (energy >= 10 && is_moving && gamepad_button_check(0,gp_face3))) { if(speed > 30) { @@ -258,6 +258,40 @@ if((mouse_check_button_pressed(mb_left) && os_type != os_psvita) || game } + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + damage_player(5); + +instance_create(other.x,other.y,obj_boom_fx); +other.direction = direction; +other.image_angle = image_angle; +other.speed = 20; + +speed = -20; + + + + diff --git a/sprites/images/s_0.png b/sprites/images/s_0.png new file mode 100644 index 0000000000000000000000000000000000000000..cc198629574e4a36a986a010a924c481d24dde1a GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^Q$d)88AvYfSy}_67>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`1M1^9%xHZ(LiI5-G~YrF=Ea29w(7BevL9R^{>@K_7+0>_Bxl_08Uz%9=(WH$LIzUP)L)H5qlntcTc!q6y iqK}ZCmEyU574z&J(dqA!cC7)L&*16m=d#Wzp$Pz4UPfL3 literal 0 HcmV?d00001 diff --git a/sprites/images/spr_blocks_2.png b/sprites/images/spr_blocks_2.png new file mode 100644 index 0000000000000000000000000000000000000000..e4c61f69d3175e44029b22db44ad8e23e1f3e965 GIT binary patch literal 904 zcmV;319$w1P)}+0GSjcN@Yk6~XvlG6t)3#BAo%QwgJUu;Kz-BUOXJ;pGZEckSZ2|@@EiDz8 z+(%$zW22B*TwE+fIH+y;&(Hn+eX$eo5(ftd2YG*gzYzr=8DrE0;G~a0O~lxhm6b0d zL56)KEY#xsPd*^gcD}s4T%uw^V0(MJ0pDx1$socuXF;Tn3?iwWCj+eF>gp=r+}t#9 zeSO`4F_)K@1s4|=`S|$wFCuJ-h6M(ZI>o8&e06m-KR!O@x3{;Ecz=KY!pFx)`F(zV z&WDGGBlTg`L854&CV=JM-d;XBIx4GakZ>bAS&gs;NW2aLY zu@X@bjR>;{AqvKWXWwGqP>Nv((ID$xlxP}N*OALfdVQaEYNEBhUIPCEBO~zJ5EZFS zcBG-_y`OZhq6jg?k$cj!z`uePIFHRL#X%7f(fCag1g!@sMShw1 zZqmw#laTpxZ+_!U$hoaqePgIu1nOoIolY%BZwPXuNFfl%|IRaE+D_VUY0O>B5)4m&VI|`GEt^75UsL^>{|5z(l$ e`i|&5qJIDs)mDe$m3KA(0000Ag?pPlm;M;rqN2)gG1;A{Ut z^8g7#YoqKIS~q=h8={+B9UJ3hupMAQNPq^S1N3c<0$f{L31CFTD{up>p#Z#B*8rr~ zvji|c3xWY}XTXJgZr4zNjDSaI0TBmLy=Mp!0G>aqnnXV%D70?~fo?13Ia~lb+ckeg zBBY(i`Z;d_>YPy+=ePq>awXpY=Nyp3JP9SDC%GN&If4N04%Fha9bkkjDWLe&n127i ZHV%X0lcV5aLrVYv002ovPDHLkV1iURf%^ae literal 0 HcmV?d00001 diff --git a/sprites/images/spr_crafting_0.png b/sprites/images/spr_crafting_0.png new file mode 100644 index 0000000000000000000000000000000000000000..79ac3dfb07b14cd43c3e3cd5cc9663faddcab30b GIT binary patch literal 781 zcmeAS@N?(olHy`uVBq!ia0vp^Q$d)64M+wq+TqW@z;wma#WAE}&fCiy3y%cw90{1V z?9#g8-At^PDtsQuH;EfMZkTia`RB=hmfqw$QJH3~@ONn{1`*#dk*TpJo192^`3!!=$5MK}vQB8wRq_zr_Gzopr0H7cy^Z)<= literal 0 HcmV?d00001 diff --git a/sprites/images/spr_intentory_0.png b/sprites/images/spr_intentory_0.png index be676e33b13043650594ebf38c7cd70ddeaedbbb..2358ecff105e3d4a72cce3d17a24744e4bc06819 100644 GIT binary patch delta 238 zcmca2dRcUWO5!X}7srr_Id88mOjKp$aX$D~lXuCMlDg{$>I76yN`9Dd(%>fusCx!Q z`%5W!ULuM-zx?p^>(^uM+_@90JNY8}?#&0-%o%zAU3KuBH090Dk{|#6&D&V_gHdF^ zl!oV|Nw)L(Ub_CxzVCeNz}@?cCU0cDviSmwJR{@x&Al8POq=Ui*qI#uXDv|i^!m1h fagxg3ulPxMvztyb?|wPVWdH(CS3j3^P6Zn(gW07*a9k?X`uCDvUhL z2RYw5?LPBgcm`{?%1&)&V-)wujv z?gFpJ&-T5FGbv8L!?wyK@7?Nmqr$^COyYT`sCb^7=imNi(Z8+l6>}fF%fGlcX@GuUOdeeYODyr3XvX{DlUEkNfrE&Lu*YAsFT0b@m zSXx*dU#dTAr*R&0sFeBl&{5&x8z%48vw2Ngl5&2zb5-E~Ti+*`6@1_RVzfyx;@U%h juR3^6n(~I2#-x2I_q9W@yvp{#)+&RitDnm{r-UW|^+eVm diff --git a/sprites/spr_blocks.sprite.gmx b/sprites/spr_blocks.sprite.gmx index 042d5c7..1246b24 100644 --- a/sprites/spr_blocks.sprite.gmx +++ b/sprites/spr_blocks.sprite.gmx @@ -22,5 +22,6 @@ images\spr_blocks_0.png images\spr_blocks_1.png + images\spr_blocks_2.png diff --git a/sprites/spr_enemy.sprite.gmx b/sprites/spr_broken_ship.sprite.gmx similarity index 91% rename from sprites/spr_enemy.sprite.gmx rename to sprites/spr_broken_ship.sprite.gmx index 13e797a..542d20f 100644 --- a/sprites/spr_enemy.sprite.gmx +++ b/sprites/spr_broken_ship.sprite.gmx @@ -20,6 +20,6 @@ 32 32 - images\spr_enemy_0.png + images\spr_broken_ship_0.png diff --git a/sprites/spr_crafting.sprite.gmx b/sprites/spr_crafting.sprite.gmx new file mode 100644 index 0000000..ac9de69 --- /dev/null +++ b/sprites/spr_crafting.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 148 + 0 + 148 + 0 + 0 + + 0 + + 0 + 149 + 149 + + images\spr_crafting_0.png + + diff --git a/sprites/spr_final.sprite.gmx b/sprites/spr_final.sprite.gmx new file mode 100644 index 0000000..ee76453 --- /dev/null +++ b/sprites/spr_final.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 148 + 0 + 148 + 0 + 0 + + 0 + + 0 + 149 + 149 + + images\spr_final_0.png + +