Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added artDUCK/duck_assets.fla
Binary file not shown.
Binary file added campaign_menu_UI_characters.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
161 changes: 161 additions & 0 deletions campaign_menu_UI_characters.xml

Large diffs are not rendered by default.

Binary file added duck/Dia/Dialougue Box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions duck/Dia/Dialougue Box.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="Dialougue Box.png">
<!-- Created with Adobe Animate version 21.0.6.41649 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="Dialogue Box0000" x="0" y="0" width="120" height="240" frameX="-538" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0001" x="120" y="0" width="191" height="240" frameX="-501" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0002" x="311" y="0" width="299" height="240" frameX="-447" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0003" x="610" y="0" width="415" height="240" frameX="-389" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0004" x="1025" y="0" width="478" height="240" frameX="-358" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0005" x="1025" y="0" width="478" height="240" frameX="-358" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0006" x="0" y="240" width="590" height="240" frameX="-302" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0007" x="590" y="240" width="706" height="240" frameX="-244" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0008" x="0" y="480" width="814" height="240" frameX="-190" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0009" x="814" y="480" width="914" height="240" frameX="-140" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0010" x="0" y="720" width="966" height="240" frameX="-114" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0011" x="0" y="720" width="966" height="240" frameX="-114" frameY="0" frameWidth="1194" frameHeight="240"/>
<SubTexture name="Dialogue Box0012" x="0" y="960" width="1194" height="240"/>
</TextureAtlas>
Binary file added duck/Portrait/DuckPortrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions duck/Portrait/DuckPortrait.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="DuckPortrait.png">
<!-- Created with Adobe Animate version 21.0.6.41649 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="duck dia0000" x="0" y="0" width="397" height="228"/>
</TextureAtlas>
Binary file added duck/bg.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 added duck/duck_assets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions duck/duck_assets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="duck_assets.png">
<!-- Created with Adobe Animate version 21.0.6.41649 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="duck down0000" x="0" y="0" width="387" height="284" frameX="0" frameY="-7" frameWidth="387" frameHeight="299"/>
<SubTexture name="duck down0001" x="387" y="0" width="387" height="299"/>
<SubTexture name="duck down0002" x="774" y="0" width="387" height="267" frameX="0" frameY="-15" frameWidth="387" frameHeight="299"/>
<SubTexture name="duck idle0000" x="1161" y="0" width="388" height="472" frameX="0" frameY="-36" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck idle0001" x="1549" y="0" width="388" height="544"/>
<SubTexture name="duck idle0002" x="1937" y="0" width="388" height="484" frameX="0" frameY="-30" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck idle0003" x="2325" y="0" width="388" height="412" frameX="0" frameY="-66" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck idle0004" x="2713" y="0" width="388" height="436" frameX="0" frameY="-54" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck idle0005" x="3101" y="0" width="388" height="472" frameX="0" frameY="-36" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck idle0006" x="3489" y="0" width="388" height="515" frameX="0" frameY="-15" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck idle0007" x="3489" y="0" width="388" height="515" frameX="0" frameY="-15" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck idle0008" x="3489" y="0" width="388" height="515" frameX="0" frameY="-15" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck idle0009" x="3489" y="0" width="388" height="515" frameX="0" frameY="-15" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck idle0010" x="3489" y="0" width="388" height="515" frameX="0" frameY="-15" frameWidth="388" frameHeight="544"/>
<SubTexture name="duck left0000" x="0" y="544" width="377" height="312" frameX="-6" frameY="-23" frameWidth="383" frameHeight="359"/>
<SubTexture name="duck left0001" x="377" y="544" width="370" height="359" frameX="-3" frameY="0" frameWidth="383" frameHeight="359"/>
<SubTexture name="duck left0002" x="747" y="544" width="365" height="319" frameX="0" frameY="-20" frameWidth="383" frameHeight="359"/>
<SubTexture name="duck left0003" x="1112" y="544" width="369" height="273" frameX="-2" frameY="-42" frameWidth="383" frameHeight="359"/>
<SubTexture name="duck right0000" x="1481" y="544" width="404" height="312" frameX="-5" frameY="-23" frameWidth="448" frameHeight="359"/>
<SubTexture name="duck right0001" x="1885" y="544" width="422" height="359" frameX="-6" frameY="0" frameWidth="448" frameHeight="359"/>
<SubTexture name="duck right0002" x="2307" y="544" width="433" height="319" frameX="-3" frameY="-20" frameWidth="448" frameHeight="359"/>
<SubTexture name="duck right0003" x="2740" y="544" width="443" height="273" frameX="-1" frameY="-42" frameWidth="448" frameHeight="359"/>
<SubTexture name="duck right0004" x="3183" y="544" width="448" height="289" frameX="0" frameY="-34" frameWidth="448" frameHeight="359"/>
<SubTexture name="duck up0000" x="3631" y="544" width="387" height="424" frameX="0" frameY="-107" frameWidth="387" frameHeight="639"/>
<SubTexture name="duck up0001" x="0" y="968" width="387" height="479" frameX="0" frameY="-80" frameWidth="387" frameHeight="639"/>
<SubTexture name="duck up0002" x="387" y="968" width="386" height="539" frameX="0" frameY="-50" frameWidth="387" frameHeight="639"/>
<SubTexture name="duck up0003" x="773" y="968" width="386" height="571" frameX="0" frameY="-34" frameWidth="387" frameHeight="639"/>
<SubTexture name="duck up0004" x="1159" y="968" width="386" height="619" frameX="0" frameY="-10" frameWidth="387" frameHeight="639"/>
<SubTexture name="duck up0005" x="1545" y="968" width="386" height="639" frameX="0" frameY="0" frameWidth="387" frameHeight="639"/>
<SubTexture name="duck up0006" x="1545" y="968" width="386" height="639" frameX="0" frameY="0" frameWidth="387" frameHeight="639"/>
</TextureAtlas>
Binary file added iconGrid.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: 7 additions & 0 deletions source_duck/APIStuff.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package;

class APIStuff
{
public static var API:String = "";
public static var EncKey:String = "";
}
309 changes: 309 additions & 0 deletions source_duck/Alphabet.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
package;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxSpriteGroup;
import flixel.math.FlxMath;
import flixel.util.FlxTimer;

using StringTools;

/**
* Loosley based on FlxTypeText lolol
*/
class Alphabet extends FlxSpriteGroup
{
public var delay:Float = 0.05;
public var paused:Bool = false;

// for menu shit
public var targetY:Float = 0;
public var isMenuItem:Bool = false;

public var text:String = "";

var _finalText:String = "";
var _curText:String = "";

public var widthOfWords:Float = FlxG.width;

var yMulti:Float = 1;

// custom shit
// amp, backslash, question mark, apostrophy, comma, angry faic, period
var lastSprite:AlphaCharacter;
var xPosResetted:Bool = false;
var lastWasSpace:Bool = false;

var splitWords:Array<String> = [];

var isBold:Bool = false;

public function new(x:Float, y:Float, text:String = "", ?bold:Bool = false, typed:Bool = false)
{
super(x, y);

_finalText = text;
this.text = text;
isBold = bold;

if (text != "")
{
if (typed)
{
startTypedText();
}
else
{
addText();
}
}
}

public function addText()
{
doSplitWords();

var xPos:Float = 0;
for (character in splitWords)
{
// if (character.fastCodeAt() == " ")
// {
// }

if (character == " " || character == "-")
{
lastWasSpace = true;
}

if (AlphaCharacter.alphabet.indexOf(character.toLowerCase()) != -1)
// if (AlphaCharacter.alphabet.contains(character.toLowerCase()))
{
if (lastSprite != null)
{
xPos = lastSprite.x + lastSprite.width;
}

if (lastWasSpace)
{
xPos += 40;
lastWasSpace = false;
}

// var letter:AlphaCharacter = new AlphaCharacter(30 * loopNum, 0);
var letter:AlphaCharacter = new AlphaCharacter(xPos, 0);

if (isBold)
letter.createBold(character);
else
{
letter.createLetter(character);
}

add(letter);

lastSprite = letter;
}

// loopNum += 1;
}
}

function doSplitWords():Void
{
splitWords = _finalText.split("");
}

public var personTalking:String = 'gf';

public function startTypedText():Void
{
_finalText = text;
doSplitWords();

// trace(arrayShit);

var loopNum:Int = 0;

var xPos:Float = 0;
var curRow:Int = 0;

new FlxTimer().start(0.05, function(tmr:FlxTimer)
{
// trace(_finalText.fastCodeAt(loopNum) + " " + _finalText.charAt(loopNum));
if (_finalText.fastCodeAt(loopNum) == "\n".code)
{
yMulti += 1;
xPosResetted = true;
xPos = 0;
curRow += 1;
}

if (splitWords[loopNum] == " ")
{
lastWasSpace = true;
}

#if (haxe >= "4.0.0")
var isNumber:Bool = AlphaCharacter.numbers.contains(splitWords[loopNum]);
var isSymbol:Bool = AlphaCharacter.symbols.contains(splitWords[loopNum]);
#else
var isNumber:Bool = AlphaCharacter.numbers.indexOf(splitWords[loopNum]) != -1;
var isSymbol:Bool = AlphaCharacter.symbols.indexOf(splitWords[loopNum]) != -1;
#end

if (AlphaCharacter.alphabet.indexOf(splitWords[loopNum].toLowerCase()) != -1 || isNumber || isSymbol)
// if (AlphaCharacter.alphabet.contains(splitWords[loopNum].toLowerCase()) || isNumber || isSymbol)

{
if (lastSprite != null && !xPosResetted)
{
lastSprite.updateHitbox();
xPos += lastSprite.width + 3;
// if (isBold)
// xPos -= 80;
}
else
{
xPosResetted = false;
}

if (lastWasSpace)
{
xPos += 20;
lastWasSpace = false;
}
// trace(_finalText.fastCodeAt(loopNum) + " " + _finalText.charAt(loopNum));

// var letter:AlphaCharacter = new AlphaCharacter(30 * loopNum, 0);
var letter:AlphaCharacter = new AlphaCharacter(xPos, 55 * yMulti);
letter.row = curRow;
if (isBold)
{
letter.createBold(splitWords[loopNum]);
}
else
{
if (isNumber)
{
letter.createNumber(splitWords[loopNum]);
}
else if (isSymbol)
{
letter.createSymbol(splitWords[loopNum]);
}
else
{
letter.createLetter(splitWords[loopNum]);
}

letter.x += 90;
}

if (FlxG.random.bool(40))
{
var daSound:String = "GF_";
FlxG.sound.play(Paths.soundRandom(daSound, 1, 4));
}

add(letter);

lastSprite = letter;
}

loopNum += 1;

tmr.time = FlxG.random.float(0.04, 0.09);
}, splitWords.length);
}

override function update(elapsed:Float)
{
if (isMenuItem)
{
var scaledY = FlxMath.remapToRange(targetY, 0, 1, 0, 1.3);

y = FlxMath.lerp(y, (scaledY * 120) + (FlxG.height * 0.48), 0.30);
x = FlxMath.lerp(x, (targetY * 20) + 90, 0.30);
}

super.update(elapsed);
}
}

class AlphaCharacter extends FlxSprite
{
public static var alphabet:String = "abcdefghijklmnopqrstuvwxyz";

public static var numbers:String = "1234567890";

public static var symbols:String = "|~#$%()*+-:;<=>@[]^_.,'!?";

public var row:Int = 0;

public function new(x:Float, y:Float)
{
super(x, y);
var tex = Paths.getSparrowAtlas('alphabet');
frames = tex;

antialiasing = true;
}

public function createBold(letter:String)
{
animation.addByPrefix(letter, letter.toUpperCase() + " bold", 24);
animation.play(letter);
updateHitbox();
}

public function createLetter(letter:String):Void
{
var letterCase:String = "lowercase";
if (letter.toLowerCase() != letter)
{
letterCase = 'capital';
}

animation.addByPrefix(letter, letter + " " + letterCase, 24);
animation.play(letter);
updateHitbox();

FlxG.log.add('the row' + row);

y = (110 - height);
y += row * 60;
}

public function createNumber(letter:String):Void
{
animation.addByPrefix(letter, letter, 24);
animation.play(letter);

updateHitbox();
}

public function createSymbol(letter:String)
{
switch (letter)
{
case '.':
animation.addByPrefix(letter, 'period', 24);
animation.play(letter);
y += 50;
case "'":
animation.addByPrefix(letter, 'apostraphie', 24);
animation.play(letter);
y -= 0;
case "?":
animation.addByPrefix(letter, 'question mark', 24);
animation.play(letter);
case "!":
animation.addByPrefix(letter, 'exclamation point', 24);
animation.play(letter);
}

updateHitbox();
}
}
Loading