From 7209fc19a83702ac94bb3d523538f873418d44dc Mon Sep 17 00:00:00 2001 From: magicalfeyfenny Date: Sun, 6 Jun 2021 04:19:04 -0400 Subject: [PATCH] added floating options --- thpj3/objects/obj_dialogue/Create_0.gml | 2 +- thpj3/objects/obj_dialogue/Draw_0.gml | 4 +- thpj3/objects/obj_options/Create_0.gml | 4 + thpj3/objects/obj_options/Draw_0.gml | 1 + thpj3/objects/obj_options/Step_0.gml | 15 ++++ thpj3/objects/obj_options/obj_options.yy | 38 +++++++++ thpj3/objects/obj_wriggle/Create_0.gml | 12 ++- thpj3/objects/obj_wriggle/Draw_0.gml | 2 +- .../scripts/scr_initialize/scr_initialize.gml | 11 ++- .../39de23b4-27b9-462d-acbd-f1a6493218b2.png | Bin 0 -> 437 bytes .../4750d189-0884-4788-a56a-7d940354fd1b.png | Bin 0 -> 437 bytes thpj3/sprites/spr_options/spr_options.yy | 79 ++++++++++++++++++ thpj3/thpj3.yyp | 2 + 13 files changed, 164 insertions(+), 6 deletions(-) create mode 100644 thpj3/objects/obj_options/Create_0.gml create mode 100644 thpj3/objects/obj_options/Draw_0.gml create mode 100644 thpj3/objects/obj_options/Step_0.gml create mode 100644 thpj3/objects/obj_options/obj_options.yy create mode 100644 thpj3/sprites/spr_options/39de23b4-27b9-462d-acbd-f1a6493218b2.png create mode 100644 thpj3/sprites/spr_options/layers/39de23b4-27b9-462d-acbd-f1a6493218b2/4750d189-0884-4788-a56a-7d940354fd1b.png create mode 100644 thpj3/sprites/spr_options/spr_options.yy diff --git a/thpj3/objects/obj_dialogue/Create_0.gml b/thpj3/objects/obj_dialogue/Create_0.gml index 76ddd22..640a2da 100644 --- a/thpj3/objects/obj_dialogue/Create_0.gml +++ b/thpj3/objects/obj_dialogue/Create_0.gml @@ -7,7 +7,7 @@ actor_left = ""; actor_left_emote = EMOTE_NEUTRAL; actor_right = ""; actor_right_emote = EMOTE_NEUTRAL; -last_active = LEFT; +last_active = LEFT_ACTOR; text_advance_ready = TEXT_LOADING; name_test = ds_queue_create(); diff --git a/thpj3/objects/obj_dialogue/Draw_0.gml b/thpj3/objects/obj_dialogue/Draw_0.gml index d66bc4c..e8559bd 100644 --- a/thpj3/objects/obj_dialogue/Draw_0.gml +++ b/thpj3/objects/obj_dialogue/Draw_0.gml @@ -12,7 +12,7 @@ if (dialogue_mode) { //TODO: Draw current active character's name draw_set_alpha(1); - if ( last_active == LEFT ) { + if ( last_active == LEFT_ACTOR ) { draw_set_alpha(.5); } draw_set_halign( fa_right ); @@ -20,7 +20,7 @@ if (dialogue_mode) { draw_set_halign( fa_left ); draw_set_alpha(1); - if ( last_active == RIGHT ) { + if ( last_active == RIGHT_ACTOR ) { draw_set_alpha(.5); } draw_text( 128, 640, actor_left ); diff --git a/thpj3/objects/obj_options/Create_0.gml b/thpj3/objects/obj_options/Create_0.gml new file mode 100644 index 0000000..73de2d4 --- /dev/null +++ b/thpj3/objects/obj_options/Create_0.gml @@ -0,0 +1,4 @@ +side_modifier = 0; + +x_target = obj_wriggle.x + ( obj_wriggle.face_dir * OPTION_FORWARD ); +y_target = obj_wriggle.y + (side_modifier * OPTION_SIDE_UNFOC); \ No newline at end of file diff --git a/thpj3/objects/obj_options/Draw_0.gml b/thpj3/objects/obj_options/Draw_0.gml new file mode 100644 index 0000000..f8e8ea5 --- /dev/null +++ b/thpj3/objects/obj_options/Draw_0.gml @@ -0,0 +1 @@ +draw_sprite_ext( spr_options, image_index, x, y, obj_wriggle.face_dir, 1, 0, c_white, .75 ); \ No newline at end of file diff --git a/thpj3/objects/obj_options/Step_0.gml b/thpj3/objects/obj_options/Step_0.gml new file mode 100644 index 0000000..6409eea --- /dev/null +++ b/thpj3/objects/obj_options/Step_0.gml @@ -0,0 +1,15 @@ +if ( keyboard_check( vk_shift ) ) { + x_target = obj_wriggle.x + ( obj_wriggle.face_dir * OPTION_FORWARD ); + y_target = obj_wriggle.y + ( side_modifier * OPTION_SIDE_FOCUS ); +} else { + x_target = obj_wriggle.x; + y_target = obj_wriggle.y + ( side_modifier * OPTION_SIDE_UNFOC ); +} + + +if ( point_distance(x, y, x_target, y_target) >= 6 ) { + move_towards_point( x_target, y_target, 5 ); +} else { + x = x_target; + y = y_target; +} \ No newline at end of file diff --git a/thpj3/objects/obj_options/obj_options.yy b/thpj3/objects/obj_options/obj_options.yy new file mode 100644 index 0000000..dfc9cb9 --- /dev/null +++ b/thpj3/objects/obj_options/obj_options.yy @@ -0,0 +1,38 @@ +{ + "spriteId": { + "name": "spr_options", + "path": "sprites/spr_options/spr_options.yy", + }, + "solid": false, + "visible": true, + "spriteMaskId": null, + "persistent": false, + "parentObjectId": null, + "physicsObject": false, + "physicsSensor": false, + "physicsShape": 1, + "physicsGroup": 1, + "physicsDensity": 0.5, + "physicsRestitution": 0.1, + "physicsLinearDamping": 0.1, + "physicsAngularDamping": 0.1, + "physicsFriction": 0.2, + "physicsStartAwake": true, + "physicsKinematic": false, + "physicsShapePoints": [], + "eventList": [ + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + ], + "properties": [], + "overriddenProperties": [], + "parent": { + "name": "thpj3", + "path": "thpj3.yyp", + }, + "resourceVersion": "1.0", + "name": "obj_options", + "tags": [], + "resourceType": "GMObject", +} \ No newline at end of file diff --git a/thpj3/objects/obj_wriggle/Create_0.gml b/thpj3/objects/obj_wriggle/Create_0.gml index d5fa43d..00c4ed8 100644 --- a/thpj3/objects/obj_wriggle/Create_0.gml +++ b/thpj3/objects/obj_wriggle/Create_0.gml @@ -12,4 +12,14 @@ emergency = 0; hyper_time = 0; hyper_tier = 0; h_move = 0; -v_move = 0; \ No newline at end of file +v_move = 0; + +var top_option = instance_create_layer(x,y,"Instances", obj_options); +with (top_option) { + side_modifier = TOP; +} + +var bottom_option = instance_create_layer(x,y,"Instances", obj_options); +with (bottom_option) { + side_modifier = BOTTOM; +} \ No newline at end of file diff --git a/thpj3/objects/obj_wriggle/Draw_0.gml b/thpj3/objects/obj_wriggle/Draw_0.gml index beaf843..6ba24d0 100644 --- a/thpj3/objects/obj_wriggle/Draw_0.gml +++ b/thpj3/objects/obj_wriggle/Draw_0.gml @@ -1,4 +1,4 @@ -draw_sprite_ext( spr_wriggle, image_index, x, y, -1 + (2 * face_dir), 1, 0, c_white, 1 * ( max( 1, recovery ) % 3 ) ); +draw_sprite_ext( spr_wriggle, image_index, x, y, face_dir, 1, 0, c_white, 1 * ( max( 1, recovery ) % 3 ) ); draw_sprite_ext( spr_wriggle_hitbox, 0, x, y, 2, 2, hitbox_rotator, c_white, .75); draw_sprite_ext( spr_wriggle_hitbox, 0, x, y, 1, 1, -hitbox_rotator, c_white, 1); \ No newline at end of file diff --git a/thpj3/scripts/scr_initialize/scr_initialize.gml b/thpj3/scripts/scr_initialize/scr_initialize.gml index 64f9c1b..efa3704 100644 --- a/thpj3/scripts/scr_initialize/scr_initialize.gml +++ b/thpj3/scripts/scr_initialize/scr_initialize.gml @@ -10,9 +10,14 @@ #macro EMOTE_CONFUSED 3 #macro EMOTE_ANGRY 4 #macro EMOTE_OUCH 5 +#macro LEFT_ACTOR 0 +#macro RIGHT_ACTOR 1 -#macro LEFT 0 + +#macro LEFT -1 #macro RIGHT 1 +#macro TOP -1 +#macro BOTTOM 1 #macro LIVES_INIT 3 #macro LIVES_MAX 5 #macro BOMBS_INIT 3 @@ -34,6 +39,10 @@ #macro BOUNDARY_TOP 32 #macro BOUNDARY_BOTTOM 688 +#macro OPTION_FORWARD 100 +#macro OPTION_SIDE_UNFOC 100 +#macro OPTION_SIDE_FOCUS 20 + function scr_initialize() { diff --git a/thpj3/sprites/spr_options/39de23b4-27b9-462d-acbd-f1a6493218b2.png b/thpj3/sprites/spr_options/39de23b4-27b9-462d-acbd-f1a6493218b2.png new file mode 100644 index 0000000000000000000000000000000000000000..cdb7a13b7105fd147c87ff509e81d99e2cbb350e GIT binary patch literal 437 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7T#lEV65?UaSW-L^LC~;-ys7Y)|D+R z>aE5HJrh|g1O-=_bqT9a7CYY;|J%kQkMsE9`Nd0^FYI8jV(8^wfW(-=RZ$yJRrf2Q zQqKDf%No)BUv7Cg`LHbM^50v}BKU$wKyV974acRs4cr_7cMWs#ZUvdkk18~MtPcb=T}ZZ^q0gAjxi-^?`Ox+>#YIcFO}sP8oeieVQ(hl+ z;B{g2ziIx{Z#mbWpBU(oxjmFKLN~7B-dWWn{mF`-r@i0AGU+ILkLsT}_KGgX#$7Ba zqVgFU2bs1qgnn$~6Y_d5SynE3;Stjd1`|Dp-;FP8=3Z$o@DFEnR84&FsP&QR1l5Jf zAD7zCUY+I;bcn4>d{z4bj}H0mcepb)T5g)jJ2A}K`EY(mPM)_;nw*{c3AO*?CtCl> m7jW(u#u_%5p#>M&!+3e>+AKESym(-AFnGH9xvXaE5HJrh|g1O-=_bqT9a7CYY;|J%kQkMsE9`Nd0^FYI8jV(8^wfW(-=RZ$yJRrf2Q zQqKDf%No)BUv7Cg`LHbM^50v}BKU$wKyV974acRs4cr_7cMWs#ZUvdkk18~MtPcb=T}ZZ^q0gAjxi-^?`Ox+>#YIcFO}sP8oeieVQ(hl+ z;B{g2ziIx{Z#mbWpBU(oxjmFKLN~7B-dWWn{mF`-r@i0AGU+ILkLsT}_KGgX#$7Ba zqVgFU2bs1qgnn$~6Y_d5SynE3;Stjd1`|Dp-;FP8=3Z$o@DFEnR84&FsP&QR1l5Jf zAD7zCUY+I;bcn4>d{z4bj}H0mcepb)T5g)jJ2A}K`EY(mPM)_;nw*{c3AO*?CtCl> m7jW(u#u_%5p#>M&!+3e>+AKESym(-AFnGH9xvX",}, + "moments": {"Keyframes":[],"resourceVersion":"1.0","resourceType":"KeyframeStore",}, + "tracks": [ + {"name":"frames","spriteId":null,"keyframes":{"Keyframes":[ + {"id":"d83fd73a-53b9-44b5-8d66-86237a6a12dc","Key":0.0,"Length":1.0,"Stretch":false,"Disabled":false,"IsCreationKey":false,"Channels":{"0":{"Id":{"name":"39de23b4-27b9-462d-acbd-f1a6493218b2","path":"sprites/spr_options/spr_options.yy",},"resourceVersion":"1.0","resourceType":"SpriteFrameKeyframe",},},"resourceVersion":"1.0","resourceType":"Keyframe",}, + ],"resourceVersion":"1.0","resourceType":"KeyframeStore",},"trackColour":0,"inheritsTrackColour":true,"builtinName":0,"traits":0,"interpolation":1,"tracks":[],"events":[],"modifiers":[],"isCreationTrack":false,"resourceVersion":"1.0","tags":[],"resourceType":"GMSpriteFramesTrack",}, + ], + "visibleRange": null, + "lockOrigin": false, + "showBackdrop": true, + "showBackdropImage": false, + "backdropImagePath": "", + "backdropImageOpacity": 0.5, + "backdropWidth": 1366, + "backdropHeight": 768, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "xorigin": 32, + "yorigin": 32, + "eventToFunction": {}, + "eventStubScript": null, + "parent": {"name":"spr_options","path":"sprites/spr_options/spr_options.yy",}, + "resourceVersion": "1.3", + "name": "spr_options", + "tags": [], + "resourceType": "GMSequence", + }, + "layers": [ + {"visible":true,"isLocked":false,"blendMode":0,"opacity":100.0,"displayName":"default","resourceVersion":"1.0","name":"4750d189-0884-4788-a56a-7d940354fd1b","tags":[],"resourceType":"GMImageLayer",}, + ], + "nineSlice": null, + "parent": { + "name": "thpj3", + "path": "thpj3.yyp", + }, + "resourceVersion": "1.0", + "name": "spr_options", + "tags": [], + "resourceType": "GMSprite", +} \ No newline at end of file diff --git a/thpj3/thpj3.yyp b/thpj3/thpj3.yyp index 1b8446c..517e247 100644 --- a/thpj3/thpj3.yyp +++ b/thpj3/thpj3.yyp @@ -2,12 +2,14 @@ "resources": [ {"id":{"name":"fn_disclaimer","path":"fonts/fn_disclaimer/fn_disclaimer.yy",},"order":1,}, {"id":{"name":"fn_title_text","path":"fonts/fn_title_text/fn_title_text.yy",},"order":0,}, + {"id":{"name":"obj_options","path":"objects/obj_options/obj_options.yy",},"order":15,}, {"id":{"name":"obj_disclaimer","path":"objects/obj_disclaimer/obj_disclaimer.yy",},"order":2,}, {"id":{"name":"spr_wriggle_hitbox","path":"sprites/spr_wriggle_hitbox/spr_wriggle_hitbox.yy",},"order":9,}, {"id":{"name":"obj_title_moon","path":"objects/obj_title_moon/obj_title_moon.yy",},"order":1,}, {"id":{"name":"spr_title_star","path":"sprites/spr_title_star/spr_title_star.yy",},"order":7,}, {"id":{"name":"scr_dialogue_start","path":"scripts/scr_dialogue_start/scr_dialogue_start.yy",},"order":10,}, {"id":{"name":"rm_disclaimer","path":"rooms/rm_disclaimer/rm_disclaimer.yy",},"order":3,}, + {"id":{"name":"spr_options","path":"sprites/spr_options/spr_options.yy",},"order":16,}, {"id":{"name":"obj_title_text","path":"objects/obj_title_text/obj_title_text.yy",},"order":3,}, {"id":{"name":"obj_wriggle","path":"objects/obj_wriggle/obj_wriggle.yy",},"order":11,}, {"id":{"name":"spr_title_bg","path":"sprites/spr_title_bg/spr_title_bg.yy",},"order":5,},