-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Kindergarten gameplay, epic dialogues, improved the shitty appl…
…es code, etc. Added Kindergarten gameplay, epic dialogues, improved the shitty apples code, etc.
- Loading branch information
Showing
26 changed files
with
1,708 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TextureAtlas imagePath="kids.png"> | ||
<!-- Created with Adobe Animate version 21.0.7.42652 --> | ||
<!-- http://www.adobe.com/products/animate.html --> | ||
<SubTexture name="bf0000" x="0" y="0" width="124" height="170" frameX="-1" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0001" x="124" y="0" width="124" height="169" frameX="-1" frameY="-1" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0002" x="248" y="0" width="125" height="168" frameX="0" frameY="-2" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0003" x="373" y="0" width="125" height="166" frameX="0" frameY="-4" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0004" x="498" y="0" width="125" height="165" frameX="0" frameY="-5" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0005" x="623" y="0" width="125" height="166" frameX="0" frameY="-4" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0006" x="748" y="0" width="125" height="168" frameX="0" frameY="-2" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0007" x="873" y="0" width="124" height="169" frameX="-1" frameY="-1" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0008" x="0" y="0" width="124" height="170" frameX="-1" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0009" x="0" y="170" width="125" height="169" frameX="-1" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0010" x="125" y="170" width="124" height="169" frameX="-2" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0011" x="249" y="170" width="125" height="169" frameX="-2" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0012" x="374" y="170" width="124" height="169" frameX="-3" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0013" x="498" y="170" width="126" height="169" frameX="-1" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0014" x="624" y="170" width="124" height="169" frameX="-2" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0015" x="748" y="170" width="125" height="169" frameX="-1" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="bf0016" x="873" y="170" width="124" height="169" frameX="-1" frameY="0" frameWidth="127" frameHeight="170"/> | ||
<SubTexture name="protagonist0000" x="0" y="339" width="90" height="155"/> | ||
<SubTexture name="protagonist0001" x="90" y="339" width="89" height="154" frameX="0" frameY="-1" frameWidth="90" frameHeight="155"/> | ||
<SubTexture name="protagonist0002" x="179" y="339" width="88" height="153" frameX="0" frameY="-2" frameWidth="90" frameHeight="155"/> | ||
<SubTexture name="protagonist0003" x="267" y="339" width="89" height="151" frameX="0" frameY="-4" frameWidth="90" frameHeight="155"/> | ||
<SubTexture name="protagonist0004" x="356" y="339" width="89" height="150" frameX="0" frameY="-5" frameWidth="90" frameHeight="155"/> | ||
<SubTexture name="protagonist0005" x="445" y="339" width="89" height="151" frameX="0" frameY="-4" frameWidth="90" frameHeight="155"/> | ||
<SubTexture name="protagonist0006" x="534" y="339" width="88" height="153" frameX="0" frameY="-2" frameWidth="90" frameHeight="155"/> | ||
<SubTexture name="protagonist0007" x="622" y="339" width="89" height="154" frameX="0" frameY="-1" frameWidth="90" frameHeight="155"/> | ||
<SubTexture name="protagonist0008" x="0" y="339" width="90" height="155"/> | ||
</TextureAtlas> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<TextureAtlas imagePath="icons.png"> | ||
<!-- Created with Adobe Animate version 21.0.7.42652 --> | ||
<!-- http://www.adobe.com/products/animate.html --> | ||
<SubTexture name="bf0000" x="0" y="0" width="128" height="112"/> | ||
<SubTexture name="bf0001" x="128" y="0" width="128" height="112"/> | ||
<SubTexture name="nugget0000" x="256" y="0" width="104" height="96"/> | ||
<SubTexture name="nugget0001" x="360" y="0" width="104" height="96"/> | ||
<SubTexture name="protagonist0000" x="0" y="112" width="88" height="96"/> | ||
<SubTexture name="protagonist0001" x="88" y="112" width="88" height="96"/> | ||
</TextureAtlas> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
package; | ||
|
||
import flixel.util.FlxColor; | ||
import lime.app.Application; | ||
import flixel.FlxCamera; | ||
import flixel.FlxG; | ||
import flixel.FlxSprite; | ||
import Kid; | ||
|
||
class BackyardState extends MusicBeatState | ||
{ | ||
var background:FlxSprite; | ||
var water:FlxSprite; | ||
var bf:KidBoyfriend; | ||
var camara:FlxCamera; | ||
|
||
var up:Bool = false; | ||
var down:Bool = false; | ||
var right:Bool = false; | ||
var left:Bool = false; | ||
|
||
var notPressedYet:Bool = true; | ||
|
||
override public function create() | ||
{ | ||
Application.current.window.title = (Main.appTitle + ' - Backyard'); | ||
|
||
#if debug | ||
flixel.addons.studio.FlxStudio.create(); | ||
#end | ||
|
||
background = new FlxSprite(0,0).loadGraphic(Paths.image('world/backyard')); | ||
background.antialiasing = false; | ||
background.flipY = true; | ||
background.setGraphicSize(Std.int(background.width * 3), Std.int(background.height * 3)); | ||
background.updateHitbox(); | ||
background.screenCenter(); | ||
add(background); | ||
|
||
bf = new KidBoyfriend(-90, 288); | ||
bf.facing = RIGHT; | ||
add(bf); | ||
|
||
water = new FlxSprite().makeGraphic(100, 100, FlxColor.YELLOW); | ||
water.alpha = 0; | ||
water.width = 519; | ||
water.height = 124; | ||
water.setGraphicSize(519, 124); | ||
water.updateHitbox(); | ||
water.setPosition(-138, 594); | ||
water.immovable = true; | ||
add(water); | ||
|
||
camara = new FlxCamera(0, 0, FlxG.width, FlxG.height); | ||
FlxG.cameras.reset(camara); | ||
camara.target = bf; | ||
//camara.setScrollBoundsRect(-128, 0, 1200 * 1.25, (480 * 1.5) + 15); this is already fine but i want to improve it | ||
camara.setScrollBoundsRect(-128, 0, 1200 * 1.275, (480 * 1.5) + 20); | ||
add(camara); | ||
|
||
FlxCamera.defaultCameras = [camara]; | ||
|
||
super.create(); | ||
} | ||
|
||
var transitioning:Bool = false; | ||
|
||
override public function update(elapsed:Float) | ||
{ | ||
if (FlxG.keys.justPressed.ANY && notPressedYet) | ||
notPressedYet = false; | ||
|
||
screenCollision(); | ||
|
||
if (bf.x < -100 && bf.y < 335 && !transitioning) | ||
{ | ||
transitioning = true; | ||
FlxG.switchState(new RoomState()); | ||
} | ||
|
||
if (FlxG.keys.anyJustPressed([ESCAPE, BACKSPACE])) | ||
{ | ||
bf.canMove = false; | ||
FlxG.switchState(new menus.MainMenuState()); | ||
} | ||
|
||
super.update(elapsed); | ||
} | ||
|
||
function screenCollision():Void | ||
{ | ||
if (notPressedYet) //because bf appears on the bottom of the screen for some reason lol | ||
return; | ||
|
||
FlxG.collide(bf, water); | ||
|
||
//95 285 | ||
if (bf.x < -128) | ||
bf.x = -128; | ||
|
||
if (bf.x > 1331) | ||
bf.x = 1331; | ||
|
||
if (bf.y < 264) | ||
bf.y = 264; | ||
|
||
if (bf.y > 642) | ||
bf.y = 642; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
package; | ||
|
||
import flixel.tweens.FlxEase; | ||
import flixel.tweens.FlxTween; | ||
import Objects.DialogueIcon; | ||
import flixel.FlxG; | ||
import flixel.FlxSprite; | ||
import flixel.addons.text.FlxTypeText; | ||
import flixel.group.FlxSpriteGroup; | ||
import flixel.text.FlxText; | ||
import flixel.util.FlxColor; | ||
import flixel.util.FlxTimer; | ||
|
||
using StringTools; | ||
|
||
class DialogueBox extends FlxSpriteGroup | ||
{ | ||
var box:FlxSprite; //box | ||
var icon:DialogueIcon; //character icon | ||
var swagDialogue:FlxTypeText; //dialogue text | ||
|
||
var curCharacter:String = ''; //uhh character | ||
var dialogueList:Array<String> = []; //dialogue | ||
var angry:String = ''; | ||
var speed:Float; | ||
var size:Int; | ||
var yellow:String = ''; | ||
|
||
public var finishThing:Void->Void; //finishing function | ||
|
||
var dialogueAppeared:Bool = false; | ||
var dialogueStarted:Bool = false; | ||
var isEnding:Bool = false; | ||
|
||
public function new(dialogueList:Array<String>) //angry:bool for the bigger text | ||
{ | ||
super(); | ||
|
||
trace("Creating DialogueBox"); | ||
|
||
this.dialogueList = dialogueList; | ||
|
||
FlxG.sound.playMusic(Paths.music('freakyMenu', 'preload'), 0); //music that fades in | ||
FlxG.sound.music.fadeIn(1, 0, 0.7); | ||
|
||
box = new FlxSprite(0, 920).loadGraphic(Paths.image('gameplay/dialogue')); //box | ||
box.antialiasing = FlxG.save.data.antialiasing; | ||
box.scrollFactor.set(); | ||
box.screenCenter(X); | ||
box.color = PlayState.dad.curColor; | ||
add(box); | ||
|
||
icon = new DialogueIcon(80, 960, PlayState.dad.curCharacter); //character icon | ||
add(icon); | ||
|
||
swagDialogue = new FlxTypeText(225, 560, Std.int(FlxG.width * 0.8), "", 64); //text | ||
swagDialogue.font = Paths.font('Crayawn-v58y.ttf'); | ||
swagDialogue.color = FlxColor.BLACK; | ||
swagDialogue.sounds = [FlxG.sound.load(Paths.sound('text'), 0.6)]; | ||
add(swagDialogue); | ||
|
||
//things movement | ||
FlxTween.tween(icon, {y: 560}, 0.5, {ease: FlxEase.sineInOut}); | ||
FlxTween.tween(box, {y: 520}, 0.5, {ease: FlxEase.sineOut, onComplete: function(_) dialogueAppeared = true }); | ||
trace("Finished creating DialogueBox"); | ||
} | ||
|
||
override function update(elapsed:Float) | ||
{ | ||
if (dialogueAppeared && !dialogueStarted) //dialogue appeared | ||
{ | ||
startDialogue(); | ||
dialogueStarted = true; | ||
} | ||
|
||
if (FlxG.keys.anyJustPressed([ENTER, SPACE, BACKSPACE, ESCAPE]) && dialogueStarted == true) | ||
{ | ||
FlxG.sound.play(Paths.sound('cancelMenu', 'preload'), 0.8); | ||
|
||
if (dialogueList[1] == null && dialogueList[0] != null) | ||
{ | ||
endDialogue(); | ||
} | ||
else | ||
{ | ||
dialogueList.remove(dialogueList[0]); | ||
startDialogue(); | ||
} | ||
} | ||
|
||
super.update(elapsed); | ||
} | ||
|
||
function startDialogue():Void | ||
{ | ||
cleanDialog(); | ||
|
||
box.color = icon.daColor; | ||
|
||
if (icon.char != curCharacter) | ||
{ | ||
remove(icon); | ||
icon = new DialogueIcon(80, 560, curCharacter); //character icon | ||
add(icon); | ||
} | ||
|
||
if (icon != null) | ||
icon.animation.play('talking'); | ||
|
||
//if angry, faster and bigger text, if not angry, normal speed and size text | ||
if (angry == 'true') | ||
{speed = 0.03; size = 128; FlxG.cameras.shake(0.0075, 0.5);} | ||
else if (angry != 'true') | ||
{speed = 0.04; size = 64;} | ||
|
||
if (yellow == 'true') | ||
swagDialogue.color = FlxColor.YELLOW; | ||
else | ||
swagDialogue.color = FlxColor.BLACK; | ||
|
||
swagDialogue.resetText(dialogueList[0]); | ||
swagDialogue.size = size; | ||
swagDialogue.start(speed, true, false, [], function() if (icon != null) icon.animation.play('idle')); | ||
} | ||
|
||
function cleanDialog():Void | ||
{ | ||
var splitName:Array<String> = dialogueList[0].split(":"); | ||
|
||
curCharacter = splitName[0]; | ||
dialogueList[0] = splitName[1]; | ||
angry = splitName[2]; | ||
yellow = splitName[3]; | ||
|
||
if (angry != 'true' || angry == null || angry == '') | ||
angry = 'false'; | ||
if (yellow != 'true' || yellow == null || yellow == '') | ||
yellow = 'false'; | ||
|
||
trace("\n\nCharacter: " + splitName[0] + '\nDialogue: "' + splitName[1] + '"\nAngry: ' + splitName[2] + "\nYellow: " + splitName[3] + "\n\n" + ((dialogueList[1] == null && dialogueList[0] != null) ? "No more dialogues.\n\n" : "Next dialogue:\n")); | ||
|
||
box.color = icon.daColor; | ||
|
||
if (icon.char != curCharacter) | ||
{ | ||
remove(icon); | ||
icon = new DialogueIcon(80, 560, curCharacter); //character icon | ||
add(icon); | ||
} | ||
} | ||
|
||
function endDialogue():Void | ||
{ | ||
if (!isEnding) | ||
{ | ||
isEnding = true; | ||
|
||
FlxG.sound.music.fadeOut(1.5, 0); | ||
|
||
swagDialogue.kill(); | ||
swagDialogue.destroy(); | ||
FlxTween.tween(icon, {y: 960}, 0.5, {ease: FlxEase.sineOut}); | ||
FlxTween.tween(box, {y: 920}, 0.5, {ease: FlxEase.sineOut, onComplete: function(_) | ||
{ | ||
finishThing(); | ||
|
||
box.kill(); | ||
box.destroy(); | ||
icon.kill(); | ||
icon.destroy(); | ||
kill(); | ||
destroy(); | ||
}}); | ||
} | ||
} | ||
} |
Oops, something went wrong.