From 77eb4b414ab3db17b74113afe875d80d7862db12 Mon Sep 17 00:00:00 2001 From: Dean Blackborough Date: Fri, 20 Dec 2024 21:56:07 +0000 Subject: [PATCH 1/5] Base enemy object --- gm-platformer.yyp | 6 +- objects/oEnemy/Create_0.gml | 17 +++ objects/oEnemy/oEnemy.yy | 39 +++++++ options/main/options_main.yy | 8 +- rooms/room01/room01.yy | 2 + .../041e5a64-66cb-4b95-9741-ba6693cc22f4.png | Bin 0 -> 761 bytes .../218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf.png | Bin 0 -> 767 bytes .../490280fc-0c07-4468-a180-4bfb1bfbc30a.png | Bin 0 -> 824 bytes .../d7b10f29-acd4-441b-8a3e-37a189eb63d4.png | Bin 0 -> 775 bytes .../db2c9a1a-c28c-4434-9eff-d226021eb1b7.png | Bin 0 -> 777 bytes .../82b415de-6014-4d11-a391-ecf515c7abc9.png | Bin 0 -> 761 bytes .../82b415de-6014-4d11-a391-ecf515c7abc9.png | Bin 0 -> 767 bytes .../82b415de-6014-4d11-a391-ecf515c7abc9.png | Bin 0 -> 824 bytes .../82b415de-6014-4d11-a391-ecf515c7abc9.png | Bin 0 -> 775 bytes .../82b415de-6014-4d11-a391-ecf515c7abc9.png | Bin 0 -> 777 bytes sprites/sEnemyIdle/sEnemyIdle.yy | 106 ++++++++++++++++++ 16 files changed, 175 insertions(+), 3 deletions(-) create mode 100644 objects/oEnemy/Create_0.gml create mode 100644 objects/oEnemy/oEnemy.yy create mode 100644 sprites/sEnemyIdle/041e5a64-66cb-4b95-9741-ba6693cc22f4.png create mode 100644 sprites/sEnemyIdle/218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf.png create mode 100644 sprites/sEnemyIdle/490280fc-0c07-4468-a180-4bfb1bfbc30a.png create mode 100644 sprites/sEnemyIdle/d7b10f29-acd4-441b-8a3e-37a189eb63d4.png create mode 100644 sprites/sEnemyIdle/db2c9a1a-c28c-4434-9eff-d226021eb1b7.png create mode 100644 sprites/sEnemyIdle/layers/041e5a64-66cb-4b95-9741-ba6693cc22f4/82b415de-6014-4d11-a391-ecf515c7abc9.png create mode 100644 sprites/sEnemyIdle/layers/218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf/82b415de-6014-4d11-a391-ecf515c7abc9.png create mode 100644 sprites/sEnemyIdle/layers/490280fc-0c07-4468-a180-4bfb1bfbc30a/82b415de-6014-4d11-a391-ecf515c7abc9.png create mode 100644 sprites/sEnemyIdle/layers/d7b10f29-acd4-441b-8a3e-37a189eb63d4/82b415de-6014-4d11-a391-ecf515c7abc9.png create mode 100644 sprites/sEnemyIdle/layers/db2c9a1a-c28c-4434-9eff-d226021eb1b7/82b415de-6014-4d11-a391-ecf515c7abc9.png create mode 100644 sprites/sEnemyIdle/sEnemyIdle.yy diff --git a/gm-platformer.yyp b/gm-platformer.yyp index 653f059..4ff2188 100644 --- a/gm-platformer.yyp +++ b/gm-platformer.yyp @@ -10,6 +10,8 @@ }, "defaultScriptType":1, "Folders":[ + {"$GMFolder":"","%Name":"Enemies","folderPath":"folders/Enemies.yy","name":"Enemies","resourceType":"GMFolder","resourceVersion":"2.0",}, + {"$GMFolder":"","%Name":"Sprites","folderPath":"folders/Enemies/Sprites.yy","name":"Sprites","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"Environment","folderPath":"folders/Environment.yy","name":"Environment","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"Sprites","folderPath":"folders/Environment/Sprites.yy","name":"Sprites","resourceType":"GMFolder","resourceVersion":"2.0",}, {"$GMFolder":"","%Name":"Game","folderPath":"folders/Game.yy","name":"Game","resourceType":"GMFolder","resourceVersion":"2.0",}, @@ -22,11 +24,12 @@ "isEcma":false, "LibraryEmitters":[], "MetaData":{ - "IDEVersion":"2024.6.2.162", + "IDEVersion":"2024.11.0.179", }, "name":"gm-platformer", "resources":[ {"id":{"name":"oCamera","path":"objects/oCamera/oCamera.yy",},}, + {"id":{"name":"oEnemy","path":"objects/oEnemy/oEnemy.yy",},}, {"id":{"name":"oGround","path":"objects/oGround/oGround.yy",},}, {"id":{"name":"oJumpThroughPlatform","path":"objects/oJumpThroughPlatform/oJumpThroughPlatform.yy",},}, {"id":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},}, @@ -35,6 +38,7 @@ {"id":{"name":"roomStart","path":"rooms/roomStart/roomStart.yy",},}, {"id":{"name":"playerCollision","path":"scripts/playerCollision/playerCollision.yy",},}, {"id":{"name":"playerInput","path":"scripts/playerInput/playerInput.yy",},}, + {"id":{"name":"sEnemyIdle","path":"sprites/sEnemyIdle/sEnemyIdle.yy",},}, {"id":{"name":"sGround","path":"sprites/sGround/sGround.yy",},}, {"id":{"name":"sJumpThroughPlatform","path":"sprites/sJumpThroughPlatform/sJumpThroughPlatform.yy",},}, {"id":{"name":"sMovingJumpThroughPlatform","path":"sprites/sMovingJumpThroughPlatform/sMovingJumpThroughPlatform.yy",},}, diff --git a/objects/oEnemy/Create_0.gml b/objects/oEnemy/Create_0.gml new file mode 100644 index 0000000..1ff3c92 --- /dev/null +++ b/objects/oEnemy/Create_0.gml @@ -0,0 +1,17 @@ + +enemyMovementSpeed = 2; + +enemyMovementDirection = 1; + +enemySpeedX = 0; +enemySpeedY = 0; + +enemySprite = sEnemyIdle; +enemySpriteIdle = sEnemyIdle; +enemySpriteFacing = 1; + +gravitySpeed = 0.3; +gravityTerminalSpeed = 6; + +// Debugging +showDebug = false; \ No newline at end of file diff --git a/objects/oEnemy/oEnemy.yy b/objects/oEnemy/oEnemy.yy new file mode 100644 index 0000000..4c34864 --- /dev/null +++ b/objects/oEnemy/oEnemy.yy @@ -0,0 +1,39 @@ +{ + "$GMObject":"", + "%Name":"oEnemy", + "eventList":[ + {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + ], + "managed":true, + "name":"oEnemy", + "overriddenProperties":[], + "parent":{ + "name":"Enemies", + "path":"folders/Enemies.yy", + }, + "parentObjectId":null, + "persistent":false, + "physicsAngularDamping":0.1, + "physicsDensity":0.5, + "physicsFriction":0.2, + "physicsGroup":1, + "physicsKinematic":false, + "physicsLinearDamping":0.1, + "physicsObject":false, + "physicsRestitution":0.1, + "physicsSensor":false, + "physicsShape":1, + "physicsShapePoints":[], + "physicsStartAwake":true, + "properties":[], + "resourceType":"GMObject", + "resourceVersion":"2.0", + "solid":false, + "spriteId":{ + "name":"sEnemyIdle", + "path":"sprites/sEnemyIdle/sEnemyIdle.yy", + }, + "spriteMaskId":null, + "visible":true, +} \ No newline at end of file diff --git a/options/main/options_main.yy b/options/main/options_main.yy index 6b02a43..6f4db6b 100644 --- a/options/main/options_main.yy +++ b/options/main/options_main.yy @@ -1,7 +1,8 @@ { - "$GMMainOptions":"v1", + "$GMMainOptions":"v3", "%Name":"Main", "name":"Main", + "option_audio_error_behaviour":true, "option_author":"", "option_collision_compatibility":false, "option_copy_on_write_enabled":false, @@ -9,8 +10,11 @@ "option_gameguid":"92c32c88-c128-481c-aafb-6d7df88e14a4", "option_gameid":"0", "option_game_speed":60, + "option_legacy_json_parsing":true, + "option_legacy_number_conversion":true, + "option_legacy_other_behaviour":true, "option_mips_for_3d_textures":false, - "option_remove_unused_assets":true, + "option_remove_unused_assets":false, "option_sci_usesci":false, "option_spine_licence":false, "option_steam_app_id":"0", diff --git a/rooms/room01/room01.yy b/rooms/room01/room01.yy index 070dab2..96bc331 100644 --- a/rooms/room01/room01.yy +++ b/rooms/room01/room01.yy @@ -29,6 +29,7 @@ {"name":"inst_2EB494A8","path":"rooms/room01/room01.yy",}, {"name":"inst_3C714167","path":"rooms/room01/room01.yy",}, {"name":"inst_454CFC1A","path":"rooms/room01/room01.yy",}, + {"name":"inst_629C1BB4","path":"rooms/room01/room01.yy",}, ], "isDnd":false, "layers":[ @@ -69,6 +70,7 @@ {"$GMRInstance":"v1","%Name":"inst_454CFC1A","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_454CFC1A","objectId":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"properties":[ {"$GMOverriddenProperty":"v1","%Name":"","name":"","objectId":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"propertyId":{"name":"moveInXAmount","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"resourceType":"GMOverriddenProperty","resourceVersion":"2.0","value":"48",}, ],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":2.0,"scaleY":1.0,"x":160.0,"y":112.0,}, + {"$GMRInstance":"v1","%Name":"inst_629C1BB4","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_629C1BB4","objectId":{"name":"oEnemy","path":"objects/oEnemy/oEnemy.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":272.0,"y":160.0,}, ],"layers":[],"name":"Instances","properties":[],"resourceType":"GMRInstanceLayer","resourceVersion":"2.0","userdefinedDepth":false,"visible":true,}, {"$GMRBackgroundLayer":"","%Name":"Background","animationFPS":15.0,"animationSpeedType":0,"colour":4288253034,"depth":100,"effectEnabled":true,"effectType":null,"gridX":32,"gridY":32,"hierarchyFrozen":false,"hspeed":0.0,"htiled":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritSubLayers":true,"inheritVisibility":true,"layers":[],"name":"Background","properties":[],"resourceType":"GMRBackgroundLayer","resourceVersion":"2.0","spriteId":null,"stretch":false,"userdefinedAnimFPS":false,"userdefinedDepth":false,"visible":true,"vspeed":0.0,"vtiled":false,"x":0,"y":0,}, ], diff --git a/sprites/sEnemyIdle/041e5a64-66cb-4b95-9741-ba6693cc22f4.png b/sprites/sEnemyIdle/041e5a64-66cb-4b95-9741-ba6693cc22f4.png new file mode 100644 index 0000000000000000000000000000000000000000..e0846dbb9c742abccfc22a0e4187bde709384795 GIT binary patch literal 761 zcmeAS@N?(olHy`uVBq!ia0vp^5|H*Yfr0Ujr;B5V$MLrz`@NYB zC29p(1?%;_-Y%Hj++373H&h_z)Z85_np=fgj_!9fcV{mQ;E523ZJA~jy`;H$3w!A$ z$JkX59u;u#i9Qafj?+77di82~%8vJwzVG`!N#;X;{U1@6^h-qxSr|N|0*_stE5z9F zBqLVtr=cjwGlg0G=0sUnnKf4*kTUkyw?_T(OMQzuc?svORPGyRDx5Ow#dT*(XXchYs zrYS*(CblOe)U0@BE5LGXlXBFPT>>mtx1t;}A3T|(;dd&Di{VDx`F;Bie7hlxJl%cq^)JnHHJ|s2R+-OSdEYWgR^&4$ z5ZP(fr*x^C8!y&hpj7B1+?ToPsH%WcR(|QzL#-@^moga|l4l;-=(9GSOFf`0`NgXm zQ85v2&h<%4F0bH<_3@pwt4=f3JnXJhzRkUJp-Gb;oH1zne3ftC$>t^%Db2)+H!ISL z)7uok9&){MrS5HMU|I5$-OHZV-77pK`{QKoRx74ykGTW3+`HtgV*du15>!iEBT7;d zOH!?pi&B9UgOP!eiLRlMu8~2Ak)f4|v6YdLwt<0_fq{D6?0OUpx%nxXX_dG&gefZ@ k25QiN+fb63n_66wm|K8b52G2A3{Ve)r>mdKI;Vst0I5JJtpET3 literal 0 HcmV?d00001 diff --git a/sprites/sEnemyIdle/218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf.png b/sprites/sEnemyIdle/218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf.png new file mode 100644 index 0000000000000000000000000000000000000000..c6f3aabf4f8aaa71a6ff23fde5e8e97a5463e7b3 GIT binary patch literal 767 zcmeAS@N?(olHy`uVBq!ia0vp^5|H*Yfr0Upr;B5V$MLrz`@Ii4 zNYtupJ<4C+Rd(^{LC4Npv8_$rDvuU*ALVL#bbrC@#myERauE}Dap>OF)q0^|7Eltv z9=qznB}EQC*>ekX&pdrMY4y5&kK1a>?^oadzE9k?-ygEkmCjXqp3J#i6)jeDeo%pJwv{iRw((@Fx z57Hds94qrPvP`~M3$U1ddK~p+mjFxEu3L_pPn$E3&fYYKk)ce$@{0J4xqBYox_6>K z`|Bd1iRT+k-S++5cmv=OuALm!od&|iC}TRy6(ORRp=bTX%E$3Au0wZ0O!s?)wM zGHSMDVz~CZ#=-K;<^}hruRd(iA=C72`3{+S@l$+Gc{|N^h3-FVe7@G)`F;G6E9Yf4 z@^zJSio6%v6B>6~Xs=*WfZ(PBbftu4}qnAZhRm+DvK1$7H?r|edo0Z}{f>T-Bxf!# zJ*bwrMwFx^mZVxG7o`Fz1|tI_6J0|iT_b}KBSR|_V=E&gZ36=<0|WKC+4U$Ia`RI% s(<*Um2vb%*4Ah_jx1l66H?_DVF}DD>9!4`J8K52pPgg&ebxsLQ0IYv3|H*Yfq_Ze)5S5wO&4{KdgQHwR`f@fdVP^w1ycSO1#2oiVb)j-d)F0k|Eix+Y4sMscs|3qlZVU)q zIDLi=i|9u7?f`Dvh?hzgClYOD%zc-Vp6>SLhB=FwwekDf_qE2H1#QL*4qNLRvi>u? z2xz=A;XUt+0@0g4{)8|vn7w>y{eIPkx5|ERWLF8RcL<1hCb-)Fjf+ln>I_f$UE1ubXj-`$&8I#qDTpC`fJ zZe^_Uzo21uQN!&2B0t8&Znq>$4;K!GHS%k%+)Rx2eS0MqIs5MRwykwrw3eMTY0{4F z<72q8UuV*f=lV9<`^Bu(<;(6*{`_1mVAcE1B`Xs0x)~U3V~nOuwwrU}|DMR5eQp~$ z?RGDGBUwK2^?_HR41!-zUVq2M&`=jGv~p|F*3Z6SDemXv1iG@PiXY3BWN(h+WeC`J zw`|`|!LOVQ6^R+~HZQI+ER+X|Pkf*K{Jx$}#!n+b(X^z!1^d}wRX z<=e&EeiRlZ=|=s$JYTCMweRo_rv{0qJGV_e!t&U5hE~bkPC2)UJ5Szx^`F0vnY;Mw z2Z44UKe-3_^?ytxSxqjEuAm46FdKf%i{an^LB{Ts5U)e?u literal 0 HcmV?d00001 diff --git a/sprites/sEnemyIdle/d7b10f29-acd4-441b-8a3e-37a189eb63d4.png b/sprites/sEnemyIdle/d7b10f29-acd4-441b-8a3e-37a189eb63d4.png new file mode 100644 index 0000000000000000000000000000000000000000..617fffd53bb5572b219d81a45b10fc4dd4cd19b1 GIT binary patch literal 775 zcmeAS@N?(olHy`uVBq!ia0vp^5|H*Yfr0Utr;B5V$MLtJ`@NMN zC2EyB9$u)3D_*3zWz&X$YcXp=1#(itb4*$rZ3U+MmVUQOTlYzqFgs6&nN!oXu84?^ z-2&RWSJb%7#JUqE9^Tkty?wLsX6u93w);%{`SITOdo{Zm?LIVqZ<>)4_30Hu!=|ap zhxWv)GX%(;&OE}jzwe~FmrV3#+LOIV z;jH6wxur|vZ%^)g-(aTnPHE}BgZYP7zHd~y5cs8obEl?C%}T*JWd z`}5cJI}g17vofLjX~vZk-F_~2m#s1VbhSNonxbULuWw6DXEvC=yq=fl@!?C)eC6Xl zqLa&u9RKZQcr1NgM`zWg{r(IGcFy2H3-kdYs0AzZ$&bi$_Y<0n?{o1HrG z@1K^N{~0g;7whm1u-0E#7ALg0%WYYu-?HUrSxZ#*$0pl zrkxV}rh7$3`2=9PP%UwdC`m~yNwrEYN(E93Mg~SEx`sx&Mg}29hE^uVRz^nJ1_o9J z2I_UQ>rpi1=BH$)RpQnVrmTDzs6hj6LrG?CYH>+oZUJsRjAl$SKs^keu6{1-oD!M< DUtT|M literal 0 HcmV?d00001 diff --git a/sprites/sEnemyIdle/db2c9a1a-c28c-4434-9eff-d226021eb1b7.png b/sprites/sEnemyIdle/db2c9a1a-c28c-4434-9eff-d226021eb1b7.png new file mode 100644 index 0000000000000000000000000000000000000000..136b016b916d1966bc7e89c93db24973e9447f8e GIT binary patch literal 777 zcmeAS@N?(olHy`uVBq!ia0vp^5|H*Yfr0Ulr;B5V$MLsQ_j@09 z5IMeIy=&2m1sy>$SB@TZTzTuJe0MUF-m3t^rUe#1-7PFTofooeNgSWjl_we_vx?Wk zqNBN+&ov-=L$l0WXy z-fQ7sB)B8*&k2>tMOBXTo){R}E^(+S+5fOwgketc%S0|A6+Pa=1}$;o*Z7-iPTHKz zF88gxZgcm}X6|D4=%2h>g%}-Pd-a{X_)lV<9Cyi6=92Pl&BgxeGhf-RXSp$VSJ?Wm zn?x&I>`ta0dG?g$woC<=&Nat+B^8DP_Z~AbHynN3WOMn`y|B8&xyiX3lrmj!Kb_{Y zC&Ob;hN%6%*IBts%FefDyI$%N*!ceB>zq`Mh4B--;@cm5s$|cVfjB4IhaR&;@&$n7LbqUYOGiNs~=uZ*_s!e$o zSE%2z%KGJkrP|SJ|GL+;iSP?Q*}h`&-Y?mOj1SJ<(>&(%KU+LE+A3v9^R#tu)^BES z$akD2)vR+RR}PpmR7+eVN>UO_QmvAUQh^kMk%5tkuAz~xkwJ)&p_PfTm64IQfq|8Q zfqLESdK3-0`6-!cmAEy8DJvfaYS4h&P?DLOT3nKtTYy^+qZyM7P!EHrtDnm{r-UW| D@r^gv literal 0 HcmV?d00001 diff --git a/sprites/sEnemyIdle/layers/041e5a64-66cb-4b95-9741-ba6693cc22f4/82b415de-6014-4d11-a391-ecf515c7abc9.png b/sprites/sEnemyIdle/layers/041e5a64-66cb-4b95-9741-ba6693cc22f4/82b415de-6014-4d11-a391-ecf515c7abc9.png new file mode 100644 index 0000000000000000000000000000000000000000..e0846dbb9c742abccfc22a0e4187bde709384795 GIT binary patch literal 761 zcmeAS@N?(olHy`uVBq!ia0vp^5|H*Yfr0Ujr;B5V$MLrz`@NYB zC29p(1?%;_-Y%Hj++373H&h_z)Z85_np=fgj_!9fcV{mQ;E523ZJA~jy`;H$3w!A$ z$JkX59u;u#i9Qafj?+77di82~%8vJwzVG`!N#;X;{U1@6^h-qxSr|N|0*_stE5z9F zBqLVtr=cjwGlg0G=0sUnnKf4*kTUkyw?_T(OMQzuc?svORPGyRDx5Ow#dT*(XXchYs zrYS*(CblOe)U0@BE5LGXlXBFPT>>mtx1t;}A3T|(;dd&Di{VDx`F;Bie7hlxJl%cq^)JnHHJ|s2R+-OSdEYWgR^&4$ z5ZP(fr*x^C8!y&hpj7B1+?ToPsH%WcR(|QzL#-@^moga|l4l;-=(9GSOFf`0`NgXm zQ85v2&h<%4F0bH<_3@pwt4=f3JnXJhzRkUJp-Gb;oH1zne3ftC$>t^%Db2)+H!ISL z)7uok9&){MrS5HMU|I5$-OHZV-77pK`{QKoRx74ykGTW3+`HtgV*du15>!iEBT7;d zOH!?pi&B9UgOP!eiLRlMu8~2Ak)f4|v6YdLwt<0_fq{D6?0OUpx%nxXX_dG&gefZ@ k25QiN+fb63n_66wm|K8b52G2A3{Ve)r>mdKI;Vst0I5JJtpET3 literal 0 HcmV?d00001 diff --git a/sprites/sEnemyIdle/layers/218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf/82b415de-6014-4d11-a391-ecf515c7abc9.png b/sprites/sEnemyIdle/layers/218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf/82b415de-6014-4d11-a391-ecf515c7abc9.png new file mode 100644 index 0000000000000000000000000000000000000000..c6f3aabf4f8aaa71a6ff23fde5e8e97a5463e7b3 GIT binary patch literal 767 zcmeAS@N?(olHy`uVBq!ia0vp^5|H*Yfr0Upr;B5V$MLrz`@Ii4 zNYtupJ<4C+Rd(^{LC4Npv8_$rDvuU*ALVL#bbrC@#myERauE}Dap>OF)q0^|7Eltv z9=qznB}EQC*>ekX&pdrMY4y5&kK1a>?^oadzE9k?-ygEkmCjXqp3J#i6)jeDeo%pJwv{iRw((@Fx z57Hds94qrPvP`~M3$U1ddK~p+mjFxEu3L_pPn$E3&fYYKk)ce$@{0J4xqBYox_6>K z`|Bd1iRT+k-S++5cmv=OuALm!od&|iC}TRy6(ORRp=bTX%E$3Au0wZ0O!s?)wM zGHSMDVz~CZ#=-K;<^}hruRd(iA=C72`3{+S@l$+Gc{|N^h3-FVe7@G)`F;G6E9Yf4 z@^zJSio6%v6B>6~Xs=*WfZ(PBbftu4}qnAZhRm+DvK1$7H?r|edo0Z}{f>T-Bxf!# zJ*bwrMwFx^mZVxG7o`Fz1|tI_6J0|iT_b}KBSR|_V=E&gZ36=<0|WKC+4U$Ia`RI% s(<*Um2vb%*4Ah_jx1l66H?_DVF}DD>9!4`J8K52pPgg&ebxsLQ0IYv3|H*Yfq_Ze)5S5wO&4{KdgQHwR`f@fdVP^w1ycSO1#2oiVb)j-d)F0k|Eix+Y4sMscs|3qlZVU)q zIDLi=i|9u7?f`Dvh?hzgClYOD%zc-Vp6>SLhB=FwwekDf_qE2H1#QL*4qNLRvi>u? z2xz=A;XUt+0@0g4{)8|vn7w>y{eIPkx5|ERWLF8RcL<1hCb-)Fjf+ln>I_f$UE1ubXj-`$&8I#qDTpC`fJ zZe^_Uzo21uQN!&2B0t8&Znq>$4;K!GHS%k%+)Rx2eS0MqIs5MRwykwrw3eMTY0{4F z<72q8UuV*f=lV9<`^Bu(<;(6*{`_1mVAcE1B`Xs0x)~U3V~nOuwwrU}|DMR5eQp~$ z?RGDGBUwK2^?_HR41!-zUVq2M&`=jGv~p|F*3Z6SDemXv1iG@PiXY3BWN(h+WeC`J zw`|`|!LOVQ6^R+~HZQI+ER+X|Pkf*K{Jx$}#!n+b(X^z!1^d}wRX z<=e&EeiRlZ=|=s$JYTCMweRo_rv{0qJGV_e!t&U5hE~bkPC2)UJ5Szx^`F0vnY;Mw z2Z44UKe-3_^?ytxSxqjEuAm46FdKf%i{an^LB{Ts5U)e?u literal 0 HcmV?d00001 diff --git a/sprites/sEnemyIdle/layers/d7b10f29-acd4-441b-8a3e-37a189eb63d4/82b415de-6014-4d11-a391-ecf515c7abc9.png b/sprites/sEnemyIdle/layers/d7b10f29-acd4-441b-8a3e-37a189eb63d4/82b415de-6014-4d11-a391-ecf515c7abc9.png new file mode 100644 index 0000000000000000000000000000000000000000..617fffd53bb5572b219d81a45b10fc4dd4cd19b1 GIT binary patch literal 775 zcmeAS@N?(olHy`uVBq!ia0vp^5|H*Yfr0Utr;B5V$MLtJ`@NMN zC2EyB9$u)3D_*3zWz&X$YcXp=1#(itb4*$rZ3U+MmVUQOTlYzqFgs6&nN!oXu84?^ z-2&RWSJb%7#JUqE9^Tkty?wLsX6u93w);%{`SITOdo{Zm?LIVqZ<>)4_30Hu!=|ap zhxWv)GX%(;&OE}jzwe~FmrV3#+LOIV z;jH6wxur|vZ%^)g-(aTnPHE}BgZYP7zHd~y5cs8obEl?C%}T*JWd z`}5cJI}g17vofLjX~vZk-F_~2m#s1VbhSNonxbULuWw6DXEvC=yq=fl@!?C)eC6Xl zqLa&u9RKZQcr1NgM`zWg{r(IGcFy2H3-kdYs0AzZ$&bi$_Y<0n?{o1HrG z@1K^N{~0g;7whm1u-0E#7ALg0%WYYu-?HUrSxZ#*$0pl zrkxV}rh7$3`2=9PP%UwdC`m~yNwrEYN(E93Mg~SEx`sx&Mg}29hE^uVRz^nJ1_o9J z2I_UQ>rpi1=BH$)RpQnVrmTDzs6hj6LrG?CYH>+oZUJsRjAl$SKs^keu6{1-oD!M< DUtT|M literal 0 HcmV?d00001 diff --git a/sprites/sEnemyIdle/layers/db2c9a1a-c28c-4434-9eff-d226021eb1b7/82b415de-6014-4d11-a391-ecf515c7abc9.png b/sprites/sEnemyIdle/layers/db2c9a1a-c28c-4434-9eff-d226021eb1b7/82b415de-6014-4d11-a391-ecf515c7abc9.png new file mode 100644 index 0000000000000000000000000000000000000000..136b016b916d1966bc7e89c93db24973e9447f8e GIT binary patch literal 777 zcmeAS@N?(olHy`uVBq!ia0vp^5|H*Yfr0Ulr;B5V$MLsQ_j@09 z5IMeIy=&2m1sy>$SB@TZTzTuJe0MUF-m3t^rUe#1-7PFTofooeNgSWjl_we_vx?Wk zqNBN+&ov-=L$l0WXy z-fQ7sB)B8*&k2>tMOBXTo){R}E^(+S+5fOwgketc%S0|A6+Pa=1}$;o*Z7-iPTHKz zF88gxZgcm}X6|D4=%2h>g%}-Pd-a{X_)lV<9Cyi6=92Pl&BgxeGhf-RXSp$VSJ?Wm zn?x&I>`ta0dG?g$woC<=&Nat+B^8DP_Z~AbHynN3WOMn`y|B8&xyiX3lrmj!Kb_{Y zC&Ob;hN%6%*IBts%FefDyI$%N*!ceB>zq`Mh4B--;@cm5s$|cVfjB4IhaR&;@&$n7LbqUYOGiNs~=uZ*_s!e$o zSE%2z%KGJkrP|SJ|GL+;iSP?Q*}h`&-Y?mOj1SJ<(>&(%KU+LE+A3v9^R#tu)^BES z$akD2)vR+RR}PpmR7+eVN>UO_QmvAUQh^kMk%5tkuAz~xkwJ)&p_PfTm64IQfq|8Q zfqLESdK3-0`6-!cmAEy8DJvfaYS4h&P?DLOT3nKtTYy^+qZyM7P!EHrtDnm{r-UW| D@r^gv literal 0 HcmV?d00001 diff --git a/sprites/sEnemyIdle/sEnemyIdle.yy b/sprites/sEnemyIdle/sEnemyIdle.yy new file mode 100644 index 0000000..7e1eddd --- /dev/null +++ b/sprites/sEnemyIdle/sEnemyIdle.yy @@ -0,0 +1,106 @@ +{ + "$GMSprite":"", + "%Name":"sEnemyIdle", + "bboxMode":0, + "bbox_bottom":31, + "bbox_left":2, + "bbox_right":20, + "bbox_top":3, + "collisionKind":1, + "collisionTolerance":0, + "DynamicTexturePage":false, + "edgeFiltering":false, + "For3D":false, + "frames":[ + {"$GMSpriteFrame":"","%Name":"db2c9a1a-c28c-4434-9eff-d226021eb1b7","name":"db2c9a1a-c28c-4434-9eff-d226021eb1b7","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"490280fc-0c07-4468-a180-4bfb1bfbc30a","name":"490280fc-0c07-4468-a180-4bfb1bfbc30a","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf","name":"218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"041e5a64-66cb-4b95-9741-ba6693cc22f4","name":"041e5a64-66cb-4b95-9741-ba6693cc22f4","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + {"$GMSpriteFrame":"","%Name":"d7b10f29-acd4-441b-8a3e-37a189eb63d4","name":"d7b10f29-acd4-441b-8a3e-37a189eb63d4","resourceType":"GMSpriteFrame","resourceVersion":"2.0",}, + ], + "gridX":0, + "gridY":0, + "height":32, + "HTile":false, + "layers":[ + {"$GMImageLayer":"","%Name":"82b415de-6014-4d11-a391-ecf515c7abc9","blendMode":0,"displayName":"default","isLocked":false,"name":"82b415de-6014-4d11-a391-ecf515c7abc9","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,}, + ], + "name":"sEnemyIdle", + "nineSlice":null, + "origin":0, + "parent":{ + "name":"Sprites", + "path":"folders/Enemies/Sprites.yy", + }, + "preMultiplyAlpha":false, + "resourceType":"GMSprite", + "resourceVersion":"2.0", + "sequence":{ + "$GMSequence":"", + "%Name":"sEnemyIdle", + "autoRecord":true, + "backdropHeight":768, + "backdropImageOpacity":0.5, + "backdropImagePath":"", + "backdropWidth":1366, + "backdropXOffset":0.0, + "backdropYOffset":0.0, + "events":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "eventStubScript":null, + "eventToFunction":{}, + "length":5.0, + "lockOrigin":false, + "moments":{ + "$KeyframeStore":"", + "Keyframes":[], + "resourceType":"KeyframeStore", + "resourceVersion":"2.0", + }, + "name":"sEnemyIdle", + "playback":1, + "playbackSpeed":4.0, + "playbackSpeedType":0, + "resourceType":"GMSequence", + "resourceVersion":"2.0", + "showBackdrop":true, + "showBackdropImage":false, + "timeUnits":1, + "tracks":[ + {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"db2c9a1a-c28c-4434-9eff-d226021eb1b7","path":"sprites/sEnemyIdle/sEnemyIdle.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"1901fbd2-ff54-4bb4-b726-76e5837b1fbb","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"490280fc-0c07-4468-a180-4bfb1bfbc30a","path":"sprites/sEnemyIdle/sEnemyIdle.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"18c6afaf-0d77-42db-a396-6e954d783aef","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"218a96c9-7dd2-45ba-8bb6-8a4f1c5b33cf","path":"sprites/sEnemyIdle/sEnemyIdle.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"61a39737-276d-4c1e-a6c1-cacafe381a3e","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"041e5a64-66cb-4b95-9741-ba6693cc22f4","path":"sprites/sEnemyIdle/sEnemyIdle.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"97858d63-d067-4de4-9e94-4ab7866b8e7e","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"d7b10f29-acd4-441b-8a3e-37a189eb63d4","path":"sprites/sEnemyIdle/sEnemyIdle.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"fd08a9b5-e722-45d5-8fc9-ba0e68b3c55e","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, + ], + "visibleRange":null, + "volume":1.0, + "xorigin":0, + "yorigin":0, + }, + "swatchColours":null, + "swfPrecision":0.5, + "textureGroupId":{ + "name":"Default", + "path":"texturegroups/Default", + }, + "type":0, + "VTile":false, + "width":24, +} \ No newline at end of file From 49a623185a20d777023ac2666d73e893b34e2653 Mon Sep 17 00:00:00 2001 From: Dean Blackborough Date: Fri, 20 Dec 2024 22:19:23 +0000 Subject: [PATCH 2/5] Enemy moves --- gm-platformer.yyp | 2 +- objects/{oEnemy => oEnemyPatrol}/Create_0.gml | 0 objects/oEnemyPatrol/Draw_0.gml | 11 +++ objects/oEnemyPatrol/Step_0.gml | 90 +++++++++++++++++++ .../oEnemyPatrol.yy} | 5 +- rooms/room01/room01.yy | 2 +- 6 files changed, 106 insertions(+), 4 deletions(-) rename objects/{oEnemy => oEnemyPatrol}/Create_0.gml (100%) create mode 100644 objects/oEnemyPatrol/Draw_0.gml create mode 100644 objects/oEnemyPatrol/Step_0.gml rename objects/{oEnemy/oEnemy.yy => oEnemyPatrol/oEnemyPatrol.yy} (83%) diff --git a/gm-platformer.yyp b/gm-platformer.yyp index 4ff2188..ccd15dd 100644 --- a/gm-platformer.yyp +++ b/gm-platformer.yyp @@ -29,7 +29,7 @@ "name":"gm-platformer", "resources":[ {"id":{"name":"oCamera","path":"objects/oCamera/oCamera.yy",},}, - {"id":{"name":"oEnemy","path":"objects/oEnemy/oEnemy.yy",},}, + {"id":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},}, {"id":{"name":"oGround","path":"objects/oGround/oGround.yy",},}, {"id":{"name":"oJumpThroughPlatform","path":"objects/oJumpThroughPlatform/oJumpThroughPlatform.yy",},}, {"id":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},}, diff --git a/objects/oEnemy/Create_0.gml b/objects/oEnemyPatrol/Create_0.gml similarity index 100% rename from objects/oEnemy/Create_0.gml rename to objects/oEnemyPatrol/Create_0.gml diff --git a/objects/oEnemyPatrol/Draw_0.gml b/objects/oEnemyPatrol/Draw_0.gml new file mode 100644 index 0000000..3b45de8 --- /dev/null +++ b/objects/oEnemyPatrol/Draw_0.gml @@ -0,0 +1,11 @@ +draw_sprite_ext( + sprite_index, + image_index, + x, + y, + image_xscale * enemySpriteFacing, + image_yscale, + image_angle, + image_blend, + image_alpha +); \ No newline at end of file diff --git a/objects/oEnemyPatrol/Step_0.gml b/objects/oEnemyPatrol/Step_0.gml new file mode 100644 index 0000000..1909661 --- /dev/null +++ b/objects/oEnemyPatrol/Step_0.gml @@ -0,0 +1,90 @@ + +getPlayerInput(); + +sprite_index = enemySpriteIdle; +image_speed = 1; + +/***************************************** +* +* Enemy movement direction an sprite facing +* +*****************************************/ + +enemyMovementDirection = enemySpriteFacing + +/***************************************** +* +* Set the enemy speed in x +* +*****************************************/ + +enemySpeedX = enemyMovementDirection * enemyMovementSpeed; + + +/***************************************** +* +* Ground collision in x +* +*****************************************/ + +if (place_meeting(x + enemySpeedX, y, oGround)) +{ + + if (snapToColliders) + { + snapToColliderOnX(enemySpeedX, oGround); + } + + enemySpeedX = 0; +} + + + +/***************************************** +* +* Assign gravity to the enemy +* +*****************************************/ + +enemySpeedY += gravitySpeed; + +if (enemySpeedY > gravityTerminalSpeed) { + enemySpeedY = gravityTerminalSpeed; +} + +/***************************************** +* +* Ground collision in y +* +*****************************************/ + +if (place_meeting(x, y + enemySpeedY, oGround)) +{ + enemySpeedY = 0; + + setPlayerOnGround(true); +} + + +/***************************************** +* +* Move the player +* +*****************************************/ + +x += enemySpeedX; +y += enemySpeedY; + + +/***************************************** +* +* Switch the sprite +* +*****************************************/ + +if (enemySpeedX == 0) +{ + sprite_index = enemyrSpriteIdle; + mask_index = enemySpriteIdle; + image_speed = 1; +} diff --git a/objects/oEnemy/oEnemy.yy b/objects/oEnemyPatrol/oEnemyPatrol.yy similarity index 83% rename from objects/oEnemy/oEnemy.yy rename to objects/oEnemyPatrol/oEnemyPatrol.yy index 4c34864..2a3f384 100644 --- a/objects/oEnemy/oEnemy.yy +++ b/objects/oEnemyPatrol/oEnemyPatrol.yy @@ -1,12 +1,13 @@ { "$GMObject":"", - "%Name":"oEnemy", + "%Name":"oEnemyPatrol", "eventList":[ {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, + {"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",}, ], "managed":true, - "name":"oEnemy", + "name":"oEnemyPatrol", "overriddenProperties":[], "parent":{ "name":"Enemies", diff --git a/rooms/room01/room01.yy b/rooms/room01/room01.yy index 96bc331..3325de4 100644 --- a/rooms/room01/room01.yy +++ b/rooms/room01/room01.yy @@ -70,7 +70,7 @@ {"$GMRInstance":"v1","%Name":"inst_454CFC1A","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_454CFC1A","objectId":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"properties":[ {"$GMOverriddenProperty":"v1","%Name":"","name":"","objectId":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"propertyId":{"name":"moveInXAmount","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"resourceType":"GMOverriddenProperty","resourceVersion":"2.0","value":"48",}, ],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":2.0,"scaleY":1.0,"x":160.0,"y":112.0,}, - {"$GMRInstance":"v1","%Name":"inst_629C1BB4","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_629C1BB4","objectId":{"name":"oEnemy","path":"objects/oEnemy/oEnemy.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":272.0,"y":160.0,}, + {"$GMRInstance":"v1","%Name":"inst_629C1BB4","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_629C1BB4","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":240.0,"y":160.0,}, ],"layers":[],"name":"Instances","properties":[],"resourceType":"GMRInstanceLayer","resourceVersion":"2.0","userdefinedDepth":false,"visible":true,}, {"$GMRBackgroundLayer":"","%Name":"Background","animationFPS":15.0,"animationSpeedType":0,"colour":4288253034,"depth":100,"effectEnabled":true,"effectType":null,"gridX":32,"gridY":32,"hierarchyFrozen":false,"hspeed":0.0,"htiled":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritSubLayers":true,"inheritVisibility":true,"layers":[],"name":"Background","properties":[],"resourceType":"GMRBackgroundLayer","resourceVersion":"2.0","spriteId":null,"stretch":false,"userdefinedAnimFPS":false,"userdefinedDepth":false,"visible":true,"vspeed":0.0,"vtiled":false,"x":0,"y":0,}, ], From a96c6b5d00fac558d7df5fe570ce9674c1deb962 Mon Sep 17 00:00:00 2001 From: Dean Blackborough Date: Fri, 20 Dec 2024 23:01:06 +0000 Subject: [PATCH 3/5] Patrolling enemies --- objects/oEnemyPatrol/Create_0.gml | 13 ++++++-- objects/oEnemyPatrol/Step_0.gml | 49 +++++++++++++++++++------------ rooms/room01/room01.yy | 6 ++-- sprites/sEnemyIdle/sEnemyIdle.yy | 6 ++-- 4 files changed, 48 insertions(+), 26 deletions(-) diff --git a/objects/oEnemyPatrol/Create_0.gml b/objects/oEnemyPatrol/Create_0.gml index 1ff3c92..18a5ae5 100644 --- a/objects/oEnemyPatrol/Create_0.gml +++ b/objects/oEnemyPatrol/Create_0.gml @@ -1,11 +1,15 @@ -enemyMovementSpeed = 2; - +enemyMovementSpeed = 1; enemyMovementDirection = 1; -enemySpeedX = 0; +enemySpeedX = 0.6; enemySpeedY = 0; +moveInXAmount = 200; +deltaX = 0; +targetX = xstart + moveInXAmount; +incrementX = true; + enemySprite = sEnemyIdle; enemySpriteIdle = sEnemyIdle; enemySpriteFacing = 1; @@ -13,5 +17,8 @@ enemySpriteFacing = 1; gravitySpeed = 0.3; gravityTerminalSpeed = 6; +// Quality options +snapToColliders = true; + // Debugging showDebug = false; \ No newline at end of file diff --git a/objects/oEnemyPatrol/Step_0.gml b/objects/oEnemyPatrol/Step_0.gml index 1909661..65b931d 100644 --- a/objects/oEnemyPatrol/Step_0.gml +++ b/objects/oEnemyPatrol/Step_0.gml @@ -4,22 +4,6 @@ getPlayerInput(); sprite_index = enemySpriteIdle; image_speed = 1; -/***************************************** -* -* Enemy movement direction an sprite facing -* -*****************************************/ - -enemyMovementDirection = enemySpriteFacing - -/***************************************** -* -* Set the enemy speed in x -* -*****************************************/ - -enemySpeedX = enemyMovementDirection * enemyMovementSpeed; - /***************************************** * @@ -65,6 +49,26 @@ if (place_meeting(x, y + enemySpeedY, oGround)) setPlayerOnGround(true); } +var nextFrameX = x; +if (incrementX == true) +{ + nextFrameX += enemySpeedX; + deltaX = nextFrameX - xprevious; + + if (nextFrameX >= targetX) + { + incrementX = false; + } +} else { + nextFrameX -= enemySpeedX; + deltaX = nextFrameX - xprevious; + + if (nextFrameX <= xstart) + { + incrementX = true; + } +} + /***************************************** * @@ -72,7 +76,7 @@ if (place_meeting(x, y + enemySpeedY, oGround)) * *****************************************/ -x += enemySpeedX; +x = nextFrameX; y += enemySpeedY; @@ -82,9 +86,18 @@ y += enemySpeedY; * *****************************************/ +if (incrementX = false) +{ + enemySpriteFacing = -1; +} +else +{ + enemySpriteFacing = 1; +} + if (enemySpeedX == 0) { - sprite_index = enemyrSpriteIdle; + sprite_index = enemySpriteIdle; mask_index = enemySpriteIdle; image_speed = 1; } diff --git a/rooms/room01/room01.yy b/rooms/room01/room01.yy index 3325de4..01e261e 100644 --- a/rooms/room01/room01.yy +++ b/rooms/room01/room01.yy @@ -30,11 +30,12 @@ {"name":"inst_3C714167","path":"rooms/room01/room01.yy",}, {"name":"inst_454CFC1A","path":"rooms/room01/room01.yy",}, {"name":"inst_629C1BB4","path":"rooms/room01/room01.yy",}, + {"name":"inst_28CBA06","path":"rooms/room01/room01.yy",}, ], "isDnd":false, "layers":[ {"$GMRInstanceLayer":"","%Name":"Instances","depth":0,"effectEnabled":true,"effectType":null,"gridX":16,"gridY":16,"hierarchyFrozen":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritSubLayers":true,"inheritVisibility":true,"instances":[ - {"$GMRInstance":"v1","%Name":"inst_78CA3942","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_78CA3942","objectId":{"name":"oPlayer","path":"objects/oPlayer/oPlayer.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":576.0,"y":112.0,}, + {"$GMRInstance":"v1","%Name":"inst_78CA3942","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_78CA3942","objectId":{"name":"oPlayer","path":"objects/oPlayer/oPlayer.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":688.0,"y":112.0,}, {"$GMRInstance":"v1","%Name":"inst_1B5B1AA2","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_1B5B1AA2","objectId":{"name":"oGround","path":"objects/oGround/oGround.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":8.0625,"scaleY":1.0,"x":240.0,"y":192.0,}, {"$GMRInstance":"v1","%Name":"inst_2110450D","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_2110450D","objectId":{"name":"oGround","path":"objects/oGround/oGround.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":10.0,"scaleY":1.0,"x":0.0,"y":96.0,}, {"$GMRInstance":"v1","%Name":"inst_2B1B743D","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_2B1B743D","objectId":{"name":"oGround","path":"objects/oGround/oGround.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":2.0625,"x":144.0,"y":112.0,}, @@ -70,7 +71,8 @@ {"$GMRInstance":"v1","%Name":"inst_454CFC1A","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_454CFC1A","objectId":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"properties":[ {"$GMOverriddenProperty":"v1","%Name":"","name":"","objectId":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"propertyId":{"name":"moveInXAmount","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"resourceType":"GMOverriddenProperty","resourceVersion":"2.0","value":"48",}, ],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":2.0,"scaleY":1.0,"x":160.0,"y":112.0,}, - {"$GMRInstance":"v1","%Name":"inst_629C1BB4","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_629C1BB4","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":240.0,"y":160.0,}, + {"$GMRInstance":"v1","%Name":"inst_629C1BB4","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_629C1BB4","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":256.0,"y":192.0,}, + {"$GMRInstance":"v1","%Name":"inst_28CBA06","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_28CBA06","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":592.0,"y":112.0,}, ],"layers":[],"name":"Instances","properties":[],"resourceType":"GMRInstanceLayer","resourceVersion":"2.0","userdefinedDepth":false,"visible":true,}, {"$GMRBackgroundLayer":"","%Name":"Background","animationFPS":15.0,"animationSpeedType":0,"colour":4288253034,"depth":100,"effectEnabled":true,"effectType":null,"gridX":32,"gridY":32,"hierarchyFrozen":false,"hspeed":0.0,"htiled":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritSubLayers":true,"inheritVisibility":true,"layers":[],"name":"Background","properties":[],"resourceType":"GMRBackgroundLayer","resourceVersion":"2.0","spriteId":null,"stretch":false,"userdefinedAnimFPS":false,"userdefinedDepth":false,"visible":true,"vspeed":0.0,"vtiled":false,"x":0,"y":0,}, ], diff --git a/sprites/sEnemyIdle/sEnemyIdle.yy b/sprites/sEnemyIdle/sEnemyIdle.yy index 7e1eddd..0db0487 100644 --- a/sprites/sEnemyIdle/sEnemyIdle.yy +++ b/sprites/sEnemyIdle/sEnemyIdle.yy @@ -27,7 +27,7 @@ ], "name":"sEnemyIdle", "nineSlice":null, - "origin":0, + "origin":7, "parent":{ "name":"Sprites", "path":"folders/Enemies/Sprites.yy", @@ -91,8 +91,8 @@ ], "visibleRange":null, "volume":1.0, - "xorigin":0, - "yorigin":0, + "xorigin":12, + "yorigin":32, }, "swatchColours":null, "swfPrecision":0.5, From 3f04b671913656a7e27bf5d79eb4a2c974524be7 Mon Sep 17 00:00:00 2001 From: Dean Blackborough Date: Fri, 20 Dec 2024 23:03:30 +0000 Subject: [PATCH 4/5] Updated README --- README.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b75f003..0110fe4 100644 --- a/README.md +++ b/README.md @@ -40,29 +40,23 @@ Check the `player/scripts/playerInput` script file, the controls should be what - Player single ground slide - Ground slide and ground dash have a cooldown - Player sprites for idle, running, jumping (up and down), dashing & slide +- Patrolling enemy base class - similar to moving platforms ## In progress - Need to show debug values/ranges for moving platforms - You can slide and then end up in a ground object -## To Do - -- Debug option to show colliders on objects, players -- Solid platforms - for puzzles -- Air Dash -- Rolling -- Wall climb & Wall hang -- Breakable walls/platforms -- Ladders -- HUD - ## How to run - Download Game Maker - Download the Project - Open the Project in Game Maker and press play +## Example usage + +Check out a game my Son is building using this starter kit [here](https://github.com/jackblackborough/platformer-starter) + ## Bugs & issues - If a moving jump through platform is moving in x and y there is a little player wobble when the platform moves in positive x and y - You can get stuck if you are right at the edge of a moving platform and connect with a ground object From a67750ddd7116bd0f99ccee5d62f421311a4210b Mon Sep 17 00:00:00 2001 From: Dean Blackborough Date: Sat, 21 Dec 2024 13:37:12 +0000 Subject: [PATCH 5/5] Patrolling enemies --- README.md | 14 ++++++++------ objects/oEnemyPatrol/Create_0.gml | 6 ++---- objects/oEnemyPatrol/Draw_0.gml | 2 +- objects/oEnemyPatrol/Step_0.gml | 8 +++++--- objects/oEnemyPatrol/oEnemyPatrol.yy | 5 ++++- rooms/room01/room01.yy | 9 +++++++-- 6 files changed, 27 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0110fe4..262ddbf 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,12 @@ A basic platformer starter project for Game Maker. I'm creating this as a starting point for myself and my kids, I'll get all the basics working for them and then we can all create our own games. -I'm adding many more comments that I would normally, these are to explain what each section of code does so my kids can easily see which parts of the code they may need to modify. +I'm adding many more comments than I would normally, these are to explain what each section of code does so my kids can easily see which parts of the code they may need to modify. I'm only building the basics of each feature, if you decide to use this starter project you are probably going to need to tweak things here and there. +Check out a game my Son is building using this starter kit [here](https://github.com/jackblackborough/platformer-starter) - it gives you and idea on how to use the Project - you should but your stuff in MyGame and extend the base objects and inherit the create step to make changes. + I've working on `showDebug` options. The intention is if you set it to true in the create event for an object useful values and information will display to help explain what is happening - this is very much to do/work in progress. @@ -30,7 +32,7 @@ Check the `player/scripts/playerInput` script file, the controls should be what - Gravity setting and terminal velocity setting - Max jumps setting - Jump through platforms -- Moving jump through platforms, move in x and/or y +- Moving jump through platforms, move in x and/or y, set speed a target - Player collision with ground - Player collision with jump through platforms - Player collision with moving jump through platforms @@ -40,7 +42,7 @@ Check the `player/scripts/playerInput` script file, the controls should be what - Player single ground slide - Ground slide and ground dash have a cooldown - Player sprites for idle, running, jumping (up and down), dashing & slide -- Patrolling enemy base class - similar to moving platforms +- Patrolling enemy base class - similar to moving platforms, set speed and target ## In progress @@ -53,13 +55,13 @@ Check the `player/scripts/playerInput` script file, the controls should be what - Download the Project - Open the Project in Game Maker and press play -## Example usage +## Bugs & issues -Check out a game my Son is building using this starter kit [here](https://github.com/jackblackborough/platformer-starter) +There are three know bugs currently - these will be fixed at some point -## Bugs & issues - If a moving jump through platform is moving in x and y there is a little player wobble when the platform moves in positive x and y - You can get stuck if you are right at the edge of a moving platform and connect with a ground object +- You can dash and slide at the same time if you are quick ## Credits diff --git a/objects/oEnemyPatrol/Create_0.gml b/objects/oEnemyPatrol/Create_0.gml index 18a5ae5..9aefc73 100644 --- a/objects/oEnemyPatrol/Create_0.gml +++ b/objects/oEnemyPatrol/Create_0.gml @@ -1,17 +1,15 @@ - enemyMovementSpeed = 1; enemyMovementDirection = 1; -enemySpeedX = 0.6; enemySpeedY = 0; -moveInXAmount = 200; deltaX = 0; targetX = xstart + moveInXAmount; incrementX = true; enemySprite = sEnemyIdle; enemySpriteIdle = sEnemyIdle; +enemySpriteRun = sEnemyIdle; enemySpriteFacing = 1; gravitySpeed = 0.3; @@ -21,4 +19,4 @@ gravityTerminalSpeed = 6; snapToColliders = true; // Debugging -showDebug = false; \ No newline at end of file +showDebug = false; diff --git a/objects/oEnemyPatrol/Draw_0.gml b/objects/oEnemyPatrol/Draw_0.gml index 3b45de8..40e4f72 100644 --- a/objects/oEnemyPatrol/Draw_0.gml +++ b/objects/oEnemyPatrol/Draw_0.gml @@ -8,4 +8,4 @@ draw_sprite_ext( image_angle, image_blend, image_alpha -); \ No newline at end of file +); diff --git a/objects/oEnemyPatrol/Step_0.gml b/objects/oEnemyPatrol/Step_0.gml index 65b931d..8a6cfef 100644 --- a/objects/oEnemyPatrol/Step_0.gml +++ b/objects/oEnemyPatrol/Step_0.gml @@ -1,5 +1,7 @@ +// Variables for object -getPlayerInput(); +// enemySpeedX = float +// moveInXAmount = float sprite_index = enemySpriteIdle; image_speed = 1; @@ -97,7 +99,7 @@ else if (enemySpeedX == 0) { - sprite_index = enemySpriteIdle; - mask_index = enemySpriteIdle; + sprite_index = enemySpriteRun; + mask_index = enemySpriteRun; image_speed = 1; } diff --git a/objects/oEnemyPatrol/oEnemyPatrol.yy b/objects/oEnemyPatrol/oEnemyPatrol.yy index 2a3f384..fe17831 100644 --- a/objects/oEnemyPatrol/oEnemyPatrol.yy +++ b/objects/oEnemyPatrol/oEnemyPatrol.yy @@ -27,7 +27,10 @@ "physicsShape":1, "physicsShapePoints":[], "physicsStartAwake":true, - "properties":[], + "properties":[ + {"$GMObjectProperty":"v1","%Name":"enemySpeedX","filters":[],"listItems":[],"multiselect":false,"name":"enemySpeedX","rangeEnabled":false,"rangeMax":10.0,"rangeMin":0.0,"resourceType":"GMObjectProperty","resourceVersion":"2.0","value":"0.6","varType":0,}, + {"$GMObjectProperty":"v1","%Name":"moveInXAmount","filters":[],"listItems":[],"multiselect":false,"name":"moveInXAmount","rangeEnabled":false,"rangeMax":10.0,"rangeMin":0.0,"resourceType":"GMObjectProperty","resourceVersion":"2.0","value":"96","varType":0,}, + ], "resourceType":"GMObject", "resourceVersion":"2.0", "solid":false, diff --git a/rooms/room01/room01.yy b/rooms/room01/room01.yy index 01e261e..6aeaaaa 100644 --- a/rooms/room01/room01.yy +++ b/rooms/room01/room01.yy @@ -71,8 +71,13 @@ {"$GMRInstance":"v1","%Name":"inst_454CFC1A","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_454CFC1A","objectId":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"properties":[ {"$GMOverriddenProperty":"v1","%Name":"","name":"","objectId":{"name":"oMovingJumpThroughPlatform","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"propertyId":{"name":"moveInXAmount","path":"objects/oMovingJumpThroughPlatform/oMovingJumpThroughPlatform.yy",},"resourceType":"GMOverriddenProperty","resourceVersion":"2.0","value":"48",}, ],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":2.0,"scaleY":1.0,"x":160.0,"y":112.0,}, - {"$GMRInstance":"v1","%Name":"inst_629C1BB4","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_629C1BB4","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":256.0,"y":192.0,}, - {"$GMRInstance":"v1","%Name":"inst_28CBA06","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_28CBA06","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"properties":[],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":592.0,"y":112.0,}, + {"$GMRInstance":"v1","%Name":"inst_629C1BB4","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_629C1BB4","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"properties":[ + {"$GMOverriddenProperty":"v1","%Name":"","name":"","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"propertyId":{"name":"enemySpeedX","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"resourceType":"GMOverriddenProperty","resourceVersion":"2.0","value":"0.6",}, + ],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":256.0,"y":192.0,}, + {"$GMRInstance":"v1","%Name":"inst_28CBA06","colour":4294967295,"frozen":false,"hasCreationCode":false,"ignore":false,"imageIndex":0,"imageSpeed":1.0,"inheritCode":false,"inheritedItemId":null,"inheritItemSettings":false,"isDnd":false,"name":"inst_28CBA06","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"properties":[ + {"$GMOverriddenProperty":"v1","%Name":"","name":"","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"propertyId":{"name":"enemySpeedX","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"resourceType":"GMOverriddenProperty","resourceVersion":"2.0","value":"0.6",}, + {"$GMOverriddenProperty":"v1","%Name":"","name":"","objectId":{"name":"oEnemyPatrol","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"propertyId":{"name":"moveInXAmount","path":"objects/oEnemyPatrol/oEnemyPatrol.yy",},"resourceType":"GMOverriddenProperty","resourceVersion":"2.0","value":"160",}, + ],"resourceType":"GMRInstance","resourceVersion":"2.0","rotation":0.0,"scaleX":1.0,"scaleY":1.0,"x":464.0,"y":112.0,}, ],"layers":[],"name":"Instances","properties":[],"resourceType":"GMRInstanceLayer","resourceVersion":"2.0","userdefinedDepth":false,"visible":true,}, {"$GMRBackgroundLayer":"","%Name":"Background","animationFPS":15.0,"animationSpeedType":0,"colour":4288253034,"depth":100,"effectEnabled":true,"effectType":null,"gridX":32,"gridY":32,"hierarchyFrozen":false,"hspeed":0.0,"htiled":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"inheritSubLayers":true,"inheritVisibility":true,"layers":[],"name":"Background","properties":[],"resourceType":"GMRBackgroundLayer","resourceVersion":"2.0","spriteId":null,"stretch":false,"userdefinedAnimFPS":false,"userdefinedDepth":false,"visible":true,"vspeed":0.0,"vtiled":false,"x":0,"y":0,}, ],