Skip to content

Commit

Permalink
concierge, angle crash fix, attempt at adding music
Browse files Browse the repository at this point in the history
  • Loading branch information
chosencharacters committed Dec 3, 2024
1 parent 36e9482 commit 3b559db
Show file tree
Hide file tree
Showing 16 changed files with 66 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!-- _________________________ Application Settings _________________________ -->

<app title="Tankmas 2024" file="Tankmas 2024" main="Main" version="1.0.0" company="Glenside Helper Elf Society" />
<app title="Tankmas 2024" file="Tankmas 2024" main="Main" version="3.0.0" company="Glenside Helper Elf Society" />

<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"-->
Expand All @@ -16,7 +16,7 @@
<!-- ____________________________ Window Settings ___________________________ -->

<!--These window settings apply to all targets-->
<window width="960" height="540" fps="60" background="#000000" hardware="true" vsync="false" />
<window width="960" height="540" fps="60" background="#000000" hardware="false" vsync="false" />

<!--HTML5-specific-->
<window if="html5" resizable="true" />
Expand Down
18 changes: 18 additions & 0 deletions assets/data/anims/general-anims.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,22 @@
<animSet image="outside-bonfire" width="919" height="1374">
<anim name="idle" fps="40ms">0t33</anim>
</animSet>

<animSet image="present-any">
<anim name="closed">0</anim>
<anim name="open">1</anim>
</animSet>

<animSet image="tombstone">
<anim name="idle">0</anim>
</animSet>

<animSet image="concierge">
<anim name="idle">0t17</anim>
</animSet>

<animSet image="dialogue-box">
<anim name="idle">0</anim>
<anim name="has-next">1t6</anim>
</animSet>
</root>
9 changes: 9 additions & 0 deletions assets/data/entries/npcs/test-npcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,13 @@
<dlg>"I died before I could live."</dlg>
</state>
</npc>
<npc name="concierge">
<state name="default">
<dlg>Good tidings... Future guests...</dlg>
<dlg>Do you desire... Accommodations of a warmer... Variety?</dlg>
<dlg>All this... Could be arranged... If one is to be... Patient...</dlg>
<dlg>For now... Consume golden morsels to your delight... For now...</dlg>
<dlg>...For now...</dlg>
</state>
</npc>
</root>
19 changes: 19 additions & 0 deletions assets/data/levels/TankmasLand/hotel_courtyard_day1.ldtkl
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,25 @@
],
"__worldX": 2014,
"__worldY": 883
},
{
"__identifier": "NPC",
"__grid": [33,138],
"__pivot": [0,0],
"__tags": [],
"__tile": null,
"__smartColor": "#FF00D0",
"iid": "0708f150-9b00-11ef-ac52-399f8d8188a6",
"width": 128,
"height": 128,
"defUid": 10,
"px": [529,2208],
"fieldInstances": [{ "__identifier": "name", "__type": "String", "__value": "concierge", "__tile": null, "defUid": 11, "realEditorValues": [{
"id": "V_String",
"params": ["concierge"]
}] }],
"__worldX": 561,
"__worldY": 2224
}
]
},
Expand Down
Binary file added assets/images/bgs/concierge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/ui/dialogue-box.aseprite
Binary file not shown.
Binary file modified assets/images/ui/dialogue-box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions source/Ctrl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package;
import flixel.FlxG;
import flixel.input.gamepad.FlxGamepad;
import flixel.input.gamepad.FlxGamepadInputID;
import flixel.input.keyboard.FlxKey;
import openfl.Assets;

/**
Expand Down Expand Up @@ -117,9 +118,9 @@ class Ctrl
left[c] = FlxG.keys.anyPressed(["A", "LEFT", controls[c][2]]);
right[c] = FlxG.keys.anyPressed(["D", "RIGHT", controls[c][3]]);

interact[c] = FlxG.keys.anyPressed([controls[c][4]]);
jinteract[c] = FlxG.keys.anyJustPressed([controls[c][4]]);
rinteract[c] = FlxG.keys.anyJustReleased([controls[c][4]]);
interact[c] = FlxG.keys.anyPressed([controls[c][4], "SPACE"]);
jinteract[c] = FlxG.keys.anyJustPressed([controls[c][4], "SPACE"]);
rinteract[c] = FlxG.keys.anyJustReleased([controls[c][4], "SPACE"]);

menu[c] = FlxG.keys.anyPressed([controls[c][5]]);
jmenu[c] = FlxG.keys.anyJustPressed([controls[c][5]]);
Expand Down
4 changes: 2 additions & 2 deletions source/entities/NPC.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NPC extends Interactable

PlayState.self.npcs.add(this);

loadGraphic(Paths.get('${name}.png'));
loadAllFromAnimationSet(name);

sstate(IDLE);
}
Expand All @@ -39,7 +39,7 @@ class NPC extends Interactable
case IDLE:
sprite_anim.anim(PresentAnimation.IDLE);
case NEARBY:
sprite_anim.anim(PresentAnimation.NEARBY);
// sprite_anim.anim(PresentAnimation.NEARBY);
if (Ctrl.jinteract[1] || FlxG.mouse.overlaps(this) && FlxG.mouse.justReleased)
start_chat();
case CHATTING:
Expand Down
2 changes: 1 addition & 1 deletion source/entities/Present.hx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Present extends Interactable

type = Interactable.InteractableType.PRESENT;

loadGraphic(Paths.get('present-$content.png'), true, 94, 94);
loadAllFromAnimationSet("present-any", 'present-$content');

PlayState.self.presents.add(this);
thumbnail = new Thumbnail(x, y - 200, Paths.get(def.file));
Expand Down
2 changes: 1 addition & 1 deletion source/squid/sprite/FlxSpriteExt.hx
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class FlxSpriteExt extends FlxSprite
public function loadAllFromAnimationSet(anim_set_name:String, ?image_override:String, unique:Bool = false, auto_play:String = "idle", unsafe:Bool = false,
?frame_offset:Int = 0):FlxSpriteExt
{
var file_path:String = Paths.get('${anim_set_name}.png');
var file_path:String = Paths.get('${image_override != null ? image_override : anim_set_name}.png', true);

animSet = Lists.getAnimationSet(anim_set_name);
loaded_image = anim_set_name;
Expand Down
2 changes: 1 addition & 1 deletion source/states/BaseState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class BaseState extends FlxState
#if !no_radio
radio = new RadioManager();
#else
SoundPlayer.music(Paths.get('christmasohyeah-stixdevs.ogg'));
SoundPlayer.music('christmasjoy-realtin3sn.ogg');
#end

#if !no_fade
Expand Down
2 changes: 1 addition & 1 deletion source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ class PlayState extends BaseState

add(minigames);
add(npcs);
add(presents);
add(username_tags);
add(users);
add(presents);
add(objects);
add(thumbnails);
add(stickers);
Expand Down
3 changes: 2 additions & 1 deletion source/ui/DialogueBox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DialogueBox extends FlxTypedGroupExt<FlxSprite>
text.fieldWidthSet(1216);
#end

bg = new FlxSpriteExt(Paths.get("dialogue-box.png"));
bg = new FlxSpriteExt().one_line("dialogue-box");

bg.setPosition(FlxG.width / 2 - bg.width / 2, 0);

Expand Down Expand Up @@ -123,6 +123,7 @@ class DialogueBox extends FlxTypedGroupExt<FlxSprite>

override function update(elapsed:Float)
{
bg.anim(line_number < dlgs.length - 1 ? "has-next" : "idle");
text.setPosition(bg.x + text_position.x, bg.y + text_position.y);
// text.offset_adjust();
fsm();
Expand Down
3 changes: 3 additions & 0 deletions source/ui/popups/StickerPackOpening.hx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ class StickerPackOpening extends FlxTypedGroupExt<FlxObject>

override function kill()
{
for (sticker in stickers)
sticker.kill();

super.kill();
}

Expand Down
3 changes: 3 additions & 0 deletions source/ui/sheets/BaseSelectSheet.hx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ class BaseSelectSheet extends FlxTypedGroupExt<FlxSprite>
{
var target:FlxSpriteExt = characterSpritesArray[locked_sheet].members[locked_selection];

if (target == null)
return;

locked_selection_overlay.center_on(target);
locked_selection_overlay.angle = target.angle;
locked_selection_overlay.scale.copyFrom(target.scale);
Expand Down

0 comments on commit 3b559db

Please sign in to comment.