Refactoring the package name
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
<!-- haxelib libraries -->
|
||||
<haxelib>
|
||||
<!-- example: <library name="..." /> -->
|
||||
<library name="hank" />
|
||||
</haxelib>
|
||||
<!-- Class files to compile (other referenced classes will automatically be included) -->
|
||||
<compileTargets>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
<!--In case you want to use the addons package-->
|
||||
<haxelib name="flixel-addons" />
|
||||
<haxelib name="hank" />
|
||||
|
||||
<!--In case you want to use the ui package-->
|
||||
<!--<haxelib name="flixel-ui" />-->
|
||||
|
||||
@@ -9,6 +9,7 @@ import flixel.FlxState;
|
||||
import flixel.system.FlxAssets;
|
||||
import flixel.ui.FlxButton;
|
||||
import flixel.addons.text.FlxTypeText;
|
||||
import hank.Story;
|
||||
|
||||
/**
|
||||
* A FlxState which can be used for the game's menu.
|
||||
@@ -17,12 +18,31 @@ class MenuState extends FlxState
|
||||
{
|
||||
var _typeText:FlxTypeText;
|
||||
var _status:FlxTypeText;
|
||||
var _story:Story;
|
||||
|
||||
function revealText() {
|
||||
if (_typeText != null) {
|
||||
remove(_typeText);
|
||||
}
|
||||
|
||||
var typeText = "";
|
||||
while (true) {
|
||||
var frame = _story.nextFrame();
|
||||
switch (frame) {
|
||||
case HasText(text):
|
||||
typeText += text;
|
||||
default:
|
||||
}
|
||||
}
|
||||
_typeText = new FlxTypeText(15, 10, FlxG.width - 30, typeText, 16, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that is called up when to state is created to set it up.
|
||||
*/
|
||||
override public function create():Void
|
||||
{
|
||||
_story = new Story("assets/scripts/main.hank");
|
||||
// Set a background color
|
||||
FlxG.cameras.bgColor = 0xff131c1b;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package src;
|
||||
package hank;
|
||||
|
||||
enum AltBehavior {
|
||||
Sequence;
|
||||
@@ -1,4 +1,4 @@
|
||||
package src;
|
||||
package hank;
|
||||
|
||||
import haxe.ds.Option;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package src;
|
||||
package hank;
|
||||
|
||||
import haxe.ds.Option;
|
||||
import src.Choice.Choice;
|
||||
import hank.Choice.Choice;
|
||||
|
||||
class LineID {
|
||||
public var sourceFile: String;
|
||||
@@ -1,4 +1,4 @@
|
||||
package src;
|
||||
package hank;
|
||||
|
||||
/* This file is cribbed from HaxeFlixel's FlxRandom.hx and FlxMath.hx (MIT License), with modifications by Nat Quayle Nelson for compatibility.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package src;
|
||||
package hank;
|
||||
|
||||
class RunStoryDemo {
|
||||
public static function main() {
|
||||
@@ -1,6 +1,5 @@
|
||||
package src;
|
||||
package hank;
|
||||
|
||||
import haxe.zip.Compress;
|
||||
import haxe.ds.Option;
|
||||
import haxe.io.Bytes;
|
||||
|
||||
@@ -10,14 +9,14 @@ import sys.io.FileOutput;
|
||||
import hscript.Parser;
|
||||
import hscript.Interp;
|
||||
|
||||
import src.HankLines.HankLine;
|
||||
import src.HankLines.LineID;
|
||||
import src.HankLines.LineType;
|
||||
import src.Alt.AltState;
|
||||
import src.Alt.AltBehavior;
|
||||
import hank.HankLines.HankLine;
|
||||
import hank.HankLines.LineID;
|
||||
import hank.HankLines.LineType;
|
||||
import hank.Alt.AltState;
|
||||
import hank.Alt.AltBehavior;
|
||||
|
||||
@:allow(tests.StoryTest)
|
||||
@:allow(src.StoryTestCase)
|
||||
@:allow(hank.StoryTestCase)
|
||||
class Story {
|
||||
private var lineCount: Int = 0;
|
||||
private var scriptLines: Array<HankLine> = new Array();
|
||||
@@ -1,4 +1,4 @@
|
||||
package src;
|
||||
package hank;
|
||||
|
||||
enum StoryFrame {
|
||||
HasText(text: String);
|
||||
@@ -1,8 +1,8 @@
|
||||
package src;
|
||||
package hank;
|
||||
|
||||
import utest.Assert;
|
||||
import src.StoryFrame;
|
||||
import src.HankLines.LineID;
|
||||
import hank.HankLines.LineID;
|
||||
import hank.StoryFrame;
|
||||
|
||||
class StoryTestCase extends utest.Test {
|
||||
/**
|
||||
@@ -1,4 +1,4 @@
|
||||
package src;
|
||||
package hank;
|
||||
|
||||
class Util {
|
||||
/**
|
||||
@@ -4,12 +4,11 @@
|
||||
"license": "MIT",
|
||||
"tags": ["cross", "game", "interactive-fiction", "ink"],
|
||||
"description": "Narrative scripting language for HaxeFlixel games based on Inkle's Ink engine",
|
||||
"version": "0.0.2",
|
||||
"classPath": "src/",
|
||||
"version": "0.0.3",
|
||||
"classPath": "hank/",
|
||||
"releasenote": "It isn't safe to use this library yet.",
|
||||
"contributors": ["NQNStudios"],
|
||||
"dependencies": {
|
||||
"hx3compat": "",
|
||||
"hscript": "",
|
||||
"utest": ""
|
||||
}
|
||||
|
||||
4
run.hxml
4
run.hxml
@@ -1,3 +1,3 @@
|
||||
-lib hscript
|
||||
-main src.RunStoryDemo
|
||||
--interp
|
||||
-main hank.RunStoryDemo
|
||||
--interp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-lib hscript
|
||||
-lib utest
|
||||
-cp src
|
||||
-cp hank
|
||||
-main tests.TestMain
|
||||
--interp
|
||||
--interp
|
||||
|
||||
@@ -2,9 +2,9 @@ package tests;
|
||||
|
||||
import utest.Test;
|
||||
import utest.Assert;
|
||||
import src.Alt.AltBehavior;
|
||||
import src.Alt.AltState;
|
||||
import src.Random.Random;
|
||||
import hank.Alt.AltBehavior;
|
||||
import hank.Alt.AltState;
|
||||
import hank.Random.Random;
|
||||
|
||||
class AltTest extends utest.Test {
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package tests;
|
||||
|
||||
import src.Story;
|
||||
import src.HankLines.HankLine;
|
||||
import src.HankLines.LineType;
|
||||
import src.HankLines.LineID;
|
||||
import src.StoryFrame;
|
||||
import hank.Story;
|
||||
import hank.HankLines.HankLine;
|
||||
import hank.HankLines.LineType;
|
||||
import hank.HankLines.LineID;
|
||||
import hank.StoryFrame;
|
||||
import utest.Assert;
|
||||
|
||||
class StoryTest extends src.StoryTestCase {
|
||||
class StoryTest extends hank.StoryTestCase {
|
||||
public function testIdEquality() {
|
||||
var lineID = new LineID('examples/TheIntercept/main.hank', 105);
|
||||
var lineID2 = new LineID('examples/TheIntercept/main.hank', 105);
|
||||
|
||||
Reference in New Issue
Block a user