diff --git a/PetGB.sublime-project b/PetGB.sublime-project new file mode 100644 index 0000000..47ea1d3 --- /dev/null +++ b/PetGB.sublime-project @@ -0,0 +1,25 @@ +{ + "folders": + [ + { + "follow_symlinks": true, + "name": "Pet.GB", + "path": "C:\\Users\\melon\\Documents\\Projects/Pet.GB" + }, + { + "follow_symlinks": true, + "name": "Flixel", + "path": "C:\\HaxeToolkit\\haxe\\lib\\flixel/4,1,1/" + }, + { + "follow_symlinks": true, + "name": "Flixel Addons", + "path": "C:\\HaxeToolkit\\haxe\\lib\\flixel-addons/2,1,0/" + }, + { + "follow_symlinks": true, + "name": "Haxe", + "path": "C:\\HaxeToolkit\\haxe\\std" + } + ] +} diff --git a/PetGB.sublime-workspace b/PetGB.sublime-workspace new file mode 100644 index 0000000..5e82e3f --- /dev/null +++ b/PetGB.sublime-workspace @@ -0,0 +1,915 @@ +{ + "auto_complete": + { + "selected_items": + [ + [ + "check", + "checkRange( )\tVoid" + ], + [ + "Max", + "MAX_LEVEL\tInt" + ], + [ + "Ma", + "MAX_LEVEL\tInt" + ], + [ + "menu", + "_menuOption\tInt" + ], + [ + "_st", + "_statDiscipline" + ], + [ + "_s", + "_statMood" + ], + [ + "_", + "_statAge" + ], + [ + "Con", + "Config__png\tString" + ], + [ + "_sp", + "_sprGel\tGel" + ], + [ + "el", + "elsapsed" + ], + [ + "E", + "Egg_New__png\tString" + ], + [ + "_spr", + "_sprSelect\tflixel.FlxSprite" + ], + [ + "_m", + "_menuOption\tInt" + ], + [ + "_spS", + "_sprSelect\tvar" + ], + [ + "men", + "_menuOption" + ], + [ + "tmp", + "tmpSelect__png\tString" + ], + [ + "Flx", + "FlxSprite\tclass" + ], + [ + "_sprS", + "_sprSelect\tflixel.FlxSprite" + ], + [ + "S", + "Select__ogg\tString" + ], + [ + "Menu", + "_menuChoice" + ], + [ + "me", + "_menuChoice" + ], + [ + "re", + "justReleased\tflixel.input.keyboard.FlxKeyList" + ], + [ + "snd", + "_sndNext\tvar" + ], + [ + "_snd", + "_sndNext" + ], + [ + "se", + "_sndSelect" + ], + [ + "_sprC", + "_sprConfig\tflixel.FlxSprite" + ], + [ + "_txt", + "_txtWipe" + ], + [ + "_Ch", + "_sprCheer\tflixel.FlxSprite" + ], + [ + "sp", + "_sprRest" + ], + [ + "FlxS", + "FlxSprite\tflixel" + ], + [ + "_tx", + "_txtConfig" + ], + [ + "From", + "fromRGB(...)\tflixel.util.FlxColor" + ], + [ + "he", + "height\tFloat" + ], + [ + "HU", + "HUD_Background__png\tString" + ], + [ + "H", + "HUD_Background__png\tString" + ], + [ + "pl", + "play(...)\tflixel.system.FlxSound" + ], + [ + "from", + "fromRGB(...)\tflixel.util.FlxColor" + ], + [ + "scr", + "screenCenter(...)\tflixel.FlxObject" + ], + [ + "bg", + "set_bgColor(...)\tflixel.util.FlxColor" + ], + [ + "p", + "player__png\tString" + ], + [ + "up", + "update" + ], + [ + "_t", + "_txtHealth\tflixel.text.FlxText" + ], + [ + "spr", + "_sprHealth" + ], + [ + "Fl", + "FlxG" + ], + [ + "FLx", + "FlxColor\tclass" + ], + [ + "forE", + "forEachAlive(...)\tUnknown<1>" + ], + [ + "grp", + "_grpEnemies" + ], + [ + "e", + "elapsed" + ], + [ + "moveTowa", + "moveTowardsPoint(...)\tVoid" + ], + [ + "idle", + "_idleTimer\tFloat" + ], + [ + "Init", + "InitState\tNull Void>" + ], + [ + "enti", + "enity" + ], + [ + "en", + "enemy" + ], + [ + "par", + "parseInt( x : String )\tNull" + ], + [ + "_grp", + "_grpEnemies\tflixel.group.FlxTypedGroup" + ], + [ + "En", + "Enemy\tclass" + ], + [ + "a", + "alive\tBool" + ], + [ + "FlxTyped", + "FlxTypedGroup\tflixel.group.FlxGroup" + ], + [ + "c", + "coin__png\tString" + ], + [ + "fun", + "Function\tflash.utils" + ], + [ + "foll", + "follow(...)\tVoid" + ], + [ + "co", + "clolide" + ], + [ + "entit", + "entityName" + ], + [ + "setTile", + "setTileProperties(...)\tVoid" + ], + [ + "tile", + "tiles__png\tString" + ], + [ + "add", + "addons\tpackage" + ], + [ + "FlxTil", + "FlxTilemap\tflixel.tile" + ], + [ + "F", + "FlxObject\tclass" + ], + [ + "move", + "movement( )\tVoid" + ], + [ + "ro", + "rotate(...)\tflixel.math.FlxPoint" + ], + [ + "FlxC", + "FlxColor" + ], + [ + "flix", + "flixel\tpackage" + ], + [ + "ass", + "assets" + ], + [ + "l", + "listdir" + ], + [ + "in", + "input" + ], + [ + "T", + "TARGET" + ] + ] + }, + "buffers": + [ + { + "file": "source/MenuState.hx", + "settings": + { + "buffer_size": 1634, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "source/PlayState.hx", + "settings": + { + "buffer_size": 720, + "encoding": "UTF-8", + "line_ending": "Unix" + } + }, + { + "file": "source/Gel.hx", + "settings": + { + "buffer_size": 1670, + "encoding": "UTF-8", + "line_ending": "Windows" + } + }, + { + "file": "source/HUD.hx", + "settings": + { + "buffer_size": 5591, + "encoding": "UTF-8", + "line_ending": "Windows" + } + } + ], + "build_system": "", + "build_system_choices": + [ + ], + "build_varint": "", + "command_palette": + { + "height": 357.0, + "last_filter": "imp", + "selected_items": + [ + [ + "imp", + "Haxe: Organize Imports" + ], + [ + "im", + "Haxe: Organize Imports" + ], + [ + "git", + "Git: Init" + ], + [ + "im\t", + "Haxe: Organize Imports" + ], + [ + "insta", + "Package Control: Install Package" + ], + [ + "impo", + "Haxe: Organize Imports" + ], + [ + "import", + "Haxe: Organize Imports" + ], + [ + "re", + "Package Control: Remove Package" + ], + [ + "install", + "Package Control: Install Package" + ], + [ + "remove", + "Package Control: Remove Package" + ], + [ + "package", + "Package Control: Remove Package" + ], + [ + "new", + "Haxe: New Class" + ], + [ + "theme", + "Boxy Theme: Activation" + ], + [ + "i", + "Haxe: Organize Imports" + ], + [ + "hexe", + "Haxe: Organize Imports" + ], + [ + "haxe", + "Haxe: Restart Server" + ], + [ + "Haxe", + "Haxe: New Class" + ], + [ + "instak", + "Package Control: Install Package" + ], + [ + "r", + "Haxe: Run build" + ], + [ + "buil", + "Haxe: Run build" + ], + [ + "run ", + "Haxe: Run build" + ], + [ + "build", + "Haxe: Run build" + ], + [ + "pack", + "Package Control: Install Package" + ], + [ + "instal", + "Package Control: Install Package" + ], + [ + "git p", + "Git: Push" + ], + [ + "ins", + "Package Control: Install Package" + ], + [ + "inst", + "Package Control: Install Package" + ] + ], + "width": 414.0 + }, + "console": + { + "height": 126.0, + "history": + [ + "import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) " + ] + }, + "distraction_free": + { + "menu_visible": true, + "show_minimap": false, + "show_open_files": false, + "show_tabs": false, + "side_bar_visible": false, + "status_bar_visible": false + }, + "expanded_folders": + [ + ], + "file_history": + [ + "/C/Users/melon/Documents/Projects/PetGB/source/Main.hx", + "/C/Users/melon/Documents/Projects/PetGB/Project.xml", + "/C/Users/melon/Documents/Projects/PetGB/source/MenuState.hx", + "/C/HaxeToolkit/haxe/lib/flixel/4,1,1/include.xml", + "/C/Users/melon/Documents/HaxeFixel_Projects/FlixelTut/source/Enemy.hx", + "/C/Users/melon/Documents/HaxeFixel_Projects/FlixelTut/source/FSM.hx", + "/C/Users/melon/Documents/HaxeFixel_Projects/FlixelTut/source/Player.hx", + "/C/Users/melon/Documents/HaxeFixel_Projects/FlixelTut/source/Coin.hx", + "/C/Users/melon/Documents/HaxeFixel_Projects/FlixelTut/source/Player2.hx", + "/C/Users/melon/Documents/HaxeFixel_Projects/FlixelTut/Project.xml", + "/C/HaxeToolkit/haxe/lib/flixel/4,1,1/flixel/FlxSubState.hx", + "/C/HaxeToolkit/haxe/lib/flixel/4,1,1/flixel/FlxGame.hx", + "/C/Users/melon/AppData/Roaming/Sublime Text 3/Packages/Haxe/Support/Default.sublime-keymap", + "/C/Users/melon/Downloads/HelloWorld/source/MenuState.hx", + "/C/Users/melon/Downloads/VITO/New folder (3)/theme.txt", + "/C/Users/melon/AppData/Roaming/BetterDiscord/themes/Shiratsuyu-Class.theme.css", + "/C/Users/melon/AppData/Roaming/BetterDiscord/plugins/Bunny.plugin.js", + "/C/Users/melon/AppData/Roaming/BetterDiscord/themes/BunniesMcGee.theme.css", + "/C/Users/melon/AppData/Roaming/BetterDiscord/themes/Discord Rounded Glass_zaku.theme.css", + "/C/Users/melon/_vimrc", + "/C/Users/melon/AppData/Roaming/BetterDiscord/themes/Discord Rounded Glass.theme.css", + "/C/Users/melon/Downloads/SFV Unlocker/readme.txt", + "/C/Users/melon/Downloads/StreetFighterV+15Tr-LNG/StreetFighterV+15Tr-LNG_v1.07 - INFO.txt", + "/C/Users/melon/Downloads/StreetFighterV+15Tr-LNG/VERY IMPORTANT!.txt", + "/C/Users/melon/Downloads/curl.cmd", + "/C/Users/melon/AppData/Local/nvim/init.vim", + "/E/Games/PS3/Tools/psnstuff/fixes/BLAZBLUE_CHREXTEND_NPUB31634_FIX101_421/links.txt", + "/C/Users/melon/Downloads/PS3/DLC/update.txt", + "/C/Users/melon/Programs/RetroArch-x86_64-Windows/retroarch.cfg", + "/E/Games/PS3/Tools/psx_classics/Instructions.txt", + "/C/Users/melon/Programs/RetroArch-x86_64-Windows/autoconfig/usb gamepad .cfg", + "/C/Users/melon/AppData/Local/Temp/7zO48AE261A/FUGAZI NFO.txt", + "/E/Games/PS3/Tools/psx_classics/PS1 Classics PSN Work Folder/PARAM.SFO", + "/E/Games/PS3/Tools/psx_classics/PS1 Classics ICON0 PICS/readme.txt", + "/E/Games/PS3/Tools/psx_classics/sign.py", + "/C/Users/melon/Downloads/something.reg", + "/C/Users/melon/Downloads/PS3/boot_plugins.txt", + "/C/Users/melon/AppData/Local/Temp/7zO0AA6D4CB/INSTALLATION.md", + "/C/Users/melon/Downloads/PS3/ps3xpad_0.8/plugins/ps3xpad/xpad_devices.txt", + "/C/Users/melon/Downloads/PS3/ps3xpad_0.8/plugins/ps3xpad/xpad_settings.txt", + "/C/Users/melon/Downloads/PS3/ps3xpad_0.8/plugins/ps3xpad/xpad_remap.txt", + "/C/Users/melon/AppData/Local/Temp/7zOCBDFDF6B/4.80.1_D-REX_Link.txt", + "/C/Users/melon/AppData/Local/Temp/7zOC4E2DADF/readme.txt", + "/C/Users/melon/Downloads/VITO/game.txt", + "/C/Users/melon/Downloads/VITO/New folder/rinCheat/README.txt", + "/C/Users/melon/AppData/Local/Temp/7zO423F271E/4.80.1_REX_Link.txt", + "/H/boot_config.ini", + "/H/luma/locales/000400000017EA00.txt", + "/C/Users/melon/AppData/Local/Temp/7zO4B221BCA/game.txt", + "/C/Users/melon/AppData/Local/Temp/7zO4075BA46/ReadMe.txt", + "/C/Users/melon/Downloads/2016-09-06_RetroArch/tmp/nxengine/livearea/contents/template.xml", + "/C/Users/melon/Downloads/Discord_Reborn.theme.css", + "/H/luma/update.cfg", + "/C/Users/melon/Downloads/VITO/vita_games.txt", + "/C/Users/melon/AppData/Local/Temp/7zO89AD9F18/README.txt", + "/C/Users/melon/Downloads/VITO/g/game.txt", + "/C/Users/melon/AppData/Local/Temp/7zO8452D42A/boot_config.ini", + "/C/msys64/usr/local/vitasdk/arm-vita-eabi/include/psp2/io/fcntl.h", + "/C/Users/melon/Documents/Projects/c-test/C-Test/hello_vita/hello_vita.mk", + "/C/msys64/usr/local/vitasdk/arm-vita-eabi/include/psp2/display.h", + "/C/Users/melon/Documents/Projects/c-test/C-Test/hello_vita/hello_vita.project", + "/C/Users/melon/Documents/Projects/c-test/C-Test/hello_vita/main.c", + "/C/Users/melon/Documents/Projects/c-test/C-Test/cmake-build-Debug/Makefile", + "/C/Users/melon/Documents/Projects/c-test/C-Test/CMakeLists.txt", + "/C/Users/melon/Documents/ClionProjects/untitled/main.c", + "/C/Users/melon/AppData/Local/Temp/7zO4F346A3E/README.md", + "/C/Users/melon/AppData/Local/Temp/7zO09B07ECB/readme.txt", + "/C/Users/melon/Downloads/VITO/vitashell-themes-master/themes/monokuma/colors.txt", + "/C/Users/melon/Downloads/VITO/colors.txt", + "/C/Program Files (x86)/Steam/steamapps/common/Disgaea PC/pad.cfg", + "/C/Users/melon/Documents/GitHub/RetroArch_Icons_Vita/build.py", + "/C/Users/melon/Downloads/VITO/vitashell-themes-master/themes/MinimalistShell-Syz/colors.txt", + "/C/Users/melon/Downloads/VITO/VitaShell/theme/theme.txt", + "/C/Users/melon/AppData/Local/Temp/7zO4519F3A0/theme.txt", + "/C/Users/melon/Documents/GitHub/EagleJab/EagleJab.py", + "/E/Games/VITA/Games/README.txt", + "/C/Users/melon/Documents/GitHub/RetroArch_Icons_Vita/cores/mupen64plus/livearea/contents/template.xml", + "/C/msys64/home/melon/Git/ebootSegs/main.c", + "/C/Users/melon/Documents/GitHub/RetroArch_Icons_Vita/cores/yabause/livearea/contents/template.xml", + "/C/Users/melon/Desktop/RA_HENkaku_Icons/tmp/nxengine_libretro/sce_sys/livearea/contents/template.xml", + "/C/Users/melon/Desktop/RA_HENkaku_Icons/tmp/nxengine_libretro/livearea/contents/template.xml", + "/C/Users/melon/AppData/Local/Temp/7zO46954437/template.xml", + "/C/Users/melon/Desktop/RA_HENkaku_Icons/tmp/sce_sys/livearea/contents/template.xml", + "/C/msys64/home/melon/Git/VitaTester/main.c", + "/C/Users/melon/Desktop/PS3_Files_Used_By_Versatile/4 - Downgrader/Download Links.txt", + "/C/Users/melon/Desktop/PS3_Files_Used_By_Versatile/2 - Verify and Dump Patching Tools/E3 Flasher Error Codes.txt", + "/C/msys64/home/melon/.bashrc", + "/C/msys64/home/melon/Git/VitaTester/Makefile", + "/C/msys64/home/melon/.profile", + "/C/msys64/home/melon/Git/vdpm-master/config.travis", + "/C/msys64/home/melon/Git/vdpm-master/_work/freetype-2.6.5/CMakeLists.txt", + "/C/msys64/home/melon/Git/vdpm-master/pkg/freetype-2.6.5", + "/C/Users/melon/Desktop/RA_HENkaku_Icons/cores/fbalpha2012/livearea/contents/template.xml", + "/C/Users/melon/Desktop/RA_HENkaku_Icons/cores/2048/livearea/contents/template.xml", + "/C/Users/melon/Desktop/RA_HENkaku_Icons/cores/dosbox/livearea/contents/template.xml", + "/C/msys64/home/melon/Git/vdpm-toolchain-deps/config.travis", + "/C/Users/melon/Desktop/RA_HENkaku_Icons/cores/gambatte/livearea/contents/template.xml", + "/C/Users/melon/Desktop/RA_HENkaku_Icons/cores/tyrquake/livearea/contents/template.xml", + "/C/msys64/home/melon/Git/vdpm-toolchain-deps/config.sample", + "/C/Users/melon/Downloads/HENkaku/Icons and Live Area Images (HENkaku)/RETR00003/livearea/contents/template.xml", + "/C/Users/melon/Downloads/2016-08-03_RetroArch/template.xml", + "/C/Users/melon/AppData/Local/Temp/7zO0186D34C/template.xml", + "/C/Users/melon/Desktop/RA_HENkaku_Icons/cores/desmume/livearea/contents/template.xml", + "/C/Users/melon/Downloads/HENkaku/Icons and Live Area Images (HENkaku)/RETR00007/livearea/contents/template.xml", + "/C/Users/melon/Downloads/HENkaku/Icons and Live Area Images (HENkaku) (1)/FRAN00001 - SMS+/livearea/contents/template.xml", + "/C/Users/melon/Downloads/HENkaku/Icons and Live Area Images (HENkaku)/RETR00010/livearea/contents/template.xml", + "/C/Users/melon/Downloads/HENkaku/Icons and Live Area Images (HENkaku) (1)/SNES LIVEAREA SQL.txt", + "/C/Users/melon/Downloads/HENkaku/samples-master/hello_world/Makefile", + "/C/Users/melon/Downloads/HENkaku/samples-master/hello_cpp_world/Makefile", + "/C/Users/melon/Downloads/HENkaku/samples-master/hello_world/main.c", + "/C/msys64/msys2_shell.cmd", + "/C/Users/melon/AppData/Local/Temp/7zO8E3FA4B2/Readme.txt", + "/C/Users/melon/Downloads/vpk-tmp/MGBA00001/sce_sys/livearea/contents/template.xml", + "/C/Users/melon/Downloads/HENkaku/samples-master/build.sh", + "/C/Users/melon/Downloads/vpk-tmp/MGBA00001/sce_sys/param.sfo", + "/C/Users/melon/Programs/Ice/emulators.txt", + "/C/Users/melon/Programs/Ice/consoles.txt", + "/C/Users/melon/Programs/Ice/config.txt", + "/C/Users/melon/Desktop/RAVBA/vbam.ini", + "/C/Users/melon/Downloads/Turn_Off_Fast_Startup.bat", + "/C/Users/melon/Downloads/RAVBA/vbam.ini", + "/C/Users/melon/Programs/KanColleViewer/Licenses/tmp/happypanda.log", + "/C/Users/melon/AppData/Local/Temp/7zO495B50A3/version.txt", + "/C/Users/melon/Programs/Ice/version.txt", + "/C/Users/melon/Downloads/[Fuwanovel] Grisaia no Kajitsu/Grisaia Installation Instructions.txt", + "/C/Users/melon/Downloads/TSAA/TMS Uncensored/README.txt", + "/E/Videos/AMVs/VC '16/Results.txt", + "/F/boot_config.ini" + ], + "find": + { + "height": 48.0 + }, + "find_in_files": + { + "height": 0.0, + "where_history": + [ + ] + }, + "find_state": + { + "case_sensitive": true, + "find_history": + [ + "stat", + "_sprGel", + "Choice", + "positive", + "Learn", + "Praise", + "Clean", + "Teach", + "_txtSleep", + "_txtStats", + "Moneny", + "_idleTmr", + "_idleTime", + "Chapter ", + "background", + "workbench", + "retrospers", + "PROJECT", + "scr", + "full", + "entry", + "tile", + "zelda", + "tile", + "chee", + "cheevos", + "inpu", + "Super", + "FalconPunch", + "listings", + "Connector" + ], + "highlight": true, + "in_selection": false, + "preserve_case": false, + "regex": false, + "replace_history": + [ + "", + "_gelPet", + "Option", + "increment", + "Train", + "Cheer", + "Wipe", + "Learn", + "_txtRest", + "_txtInfo", + "Money", + "_idleTimer", + "CH", + "TARGET", + "EagleJab" + ], + "reverse": false, + "show_context": true, + "use_buffer2": true, + "whole_word": false, + "wrap": true + }, + "groups": + [ + { + "selected": 2, + "sheets": + [ + { + "buffer": 0, + "file": "source/MenuState.hx", + "semi_transient": false, + "settings": + { + "buffer_size": 1634, + "regions": + { + }, + "selection": + [ + [ + 878, + 878 + ] + ], + "settings": + { + "haxe-build-id": 0, + "syntax": "Packages/Haxe/Haxe.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 156.0, + "zoom_level": 1.0 + }, + "stack_index": 3, + "type": "text" + }, + { + "buffer": 1, + "file": "source/PlayState.hx", + "semi_transient": false, + "settings": + { + "buffer_size": 720, + "regions": + { + }, + "selection": + [ + [ + 8, + 8 + ] + ], + "settings": + { + "haxe-build-id": 0, + "syntax": "Packages/Haxe/Haxe.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 0.0, + "zoom_level": 1.0 + }, + "stack_index": 2, + "type": "text" + }, + { + "buffer": 2, + "file": "source/Gel.hx", + "semi_transient": false, + "settings": + { + "buffer_size": 1670, + "regions": + { + }, + "selection": + [ + [ + 1595, + 1595 + ] + ], + "settings": + { + "haxe-build-id": 0, + "syntax": "Packages/Haxe/Haxe.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 780.0, + "zoom_level": 1.0 + }, + "stack_index": 0, + "type": "text" + }, + { + "buffer": 3, + "file": "source/HUD.hx", + "semi_transient": false, + "settings": + { + "buffer_size": 5591, + "regions": + { + }, + "selection": + [ + [ + 2861, + 2861 + ] + ], + "settings": + { + "haxe-build-id": 0, + "syntax": "Packages/Haxe/Haxe.tmLanguage", + "translate_tabs_to_spaces": false + }, + "translation.x": 0.0, + "translation.y": 1762.0, + "zoom_level": 1.0 + }, + "stack_index": 1, + "type": "text" + } + ] + } + ], + "incremental_find": + { + "height": 26.0 + }, + "input": + { + "height": 31.0 + }, + "layout": + { + "cells": + [ + [ + 0, + 0, + 1, + 1 + ] + ], + "cols": + [ + 0.0, + 1.0 + ], + "rows": + [ + 0.0, + 1.0 + ] + }, + "menu_visible": true, + "output.exec": + { + "height": 94.0 + }, + "output.find_results": + { + "height": 0.0 + }, + "pinned_build_system": "Packages/Python 3/Python3.sublime-build", + "project": "PetGB.sublime-project", + "replace": + { + "height": 90.0 + }, + "save_all_on_build": true, + "select_file": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "select_project": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "select_symbol": + { + "height": 0.0, + "last_filter": "", + "selected_items": + [ + ], + "width": 0.0 + }, + "selected_group": 0, + "settings": + { + }, + "show_minimap": true, + "show_open_files": false, + "show_tabs": true, + "side_bar_visible": true, + "side_bar_width": 207.0, + "status_bar_visible": true, + "template_settings": + { + } +} diff --git a/Project.xml b/Project.xml new file mode 100644 index 0000000..d81524d --- /dev/null +++ b/Project.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/data/EarlyGameBoy.ttf b/assets/data/EarlyGameBoy.ttf new file mode 100644 index 0000000..5cf4045 Binary files /dev/null and b/assets/data/EarlyGameBoy.ttf differ diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 0000000..13d7cc4 Binary files /dev/null and b/assets/icon.png differ diff --git a/assets/images/Cheer.png b/assets/images/Cheer.png new file mode 100644 index 0000000..08660be Binary files /dev/null and b/assets/images/Cheer.png differ diff --git a/assets/images/Config.png b/assets/images/Config.png new file mode 100644 index 0000000..591f3ad Binary files /dev/null and b/assets/images/Config.png differ diff --git a/assets/images/Egg.png b/assets/images/Egg.png new file mode 100644 index 0000000..564a581 Binary files /dev/null and b/assets/images/Egg.png differ diff --git a/assets/images/Egg2.png b/assets/images/Egg2.png new file mode 100644 index 0000000..ca700d1 Binary files /dev/null and b/assets/images/Egg2.png differ diff --git a/assets/images/Egg3.png b/assets/images/Egg3.png new file mode 100644 index 0000000..5b31771 Binary files /dev/null and b/assets/images/Egg3.png differ diff --git a/assets/images/Feed.png b/assets/images/Feed.png new file mode 100644 index 0000000..72034a7 Binary files /dev/null and b/assets/images/Feed.png differ diff --git a/assets/images/HUD_Background.png b/assets/images/HUD_Background.png new file mode 100644 index 0000000..86963b3 Binary files /dev/null and b/assets/images/HUD_Background.png differ diff --git a/assets/images/Info.png b/assets/images/Info.png new file mode 100644 index 0000000..301e713 Binary files /dev/null and b/assets/images/Info.png differ diff --git a/assets/images/Player.png b/assets/images/Player.png new file mode 100644 index 0000000..ba34432 Binary files /dev/null and b/assets/images/Player.png differ diff --git a/assets/images/Rest.png b/assets/images/Rest.png new file mode 100644 index 0000000..5ee7318 Binary files /dev/null and b/assets/images/Rest.png differ diff --git a/assets/images/Rest_old.png b/assets/images/Rest_old.png new file mode 100644 index 0000000..a692945 Binary files /dev/null and b/assets/images/Rest_old.png differ diff --git a/assets/images/Scold.png b/assets/images/Scold.png new file mode 100644 index 0000000..3752e8d Binary files /dev/null and b/assets/images/Scold.png differ diff --git a/assets/images/Train.png b/assets/images/Train.png new file mode 100644 index 0000000..1bfe2ce Binary files /dev/null and b/assets/images/Train.png differ diff --git a/assets/images/Wipe.png b/assets/images/Wipe.png new file mode 100644 index 0000000..5966a73 Binary files /dev/null and b/assets/images/Wipe.png differ diff --git a/assets/images/background.png b/assets/images/background.png new file mode 100644 index 0000000..c2ff869 Binary files /dev/null and b/assets/images/background.png differ diff --git a/assets/images/tmp20.png b/assets/images/tmp20.png new file mode 100644 index 0000000..fefcd82 Binary files /dev/null and b/assets/images/tmp20.png differ diff --git a/assets/images/tmp32.png b/assets/images/tmp32.png new file mode 100644 index 0000000..8465184 Binary files /dev/null and b/assets/images/tmp32.png differ diff --git a/assets/images/tmpSelect.png b/assets/images/tmpSelect.png new file mode 100644 index 0000000..f5ad6ce Binary files /dev/null and b/assets/images/tmpSelect.png differ diff --git a/assets/music/music-goes-here.txt b/assets/music/music-goes-here.txt new file mode 100644 index 0000000..e69de29 diff --git a/assets/sounds/Next.ogg b/assets/sounds/Next.ogg new file mode 100644 index 0000000..5f7298e Binary files /dev/null and b/assets/sounds/Next.ogg differ diff --git a/assets/sounds/Select.ogg b/assets/sounds/Select.ogg new file mode 100644 index 0000000..99fbf49 Binary files /dev/null and b/assets/sounds/Select.ogg differ diff --git a/export/.build b/export/.build new file mode 100644 index 0000000..f123c4f --- /dev/null +++ b/export/.build @@ -0,0 +1 @@ +251 \ No newline at end of file diff --git a/export/windows/neko/bin/Pet.GB.exe b/export/windows/neko/bin/Pet.GB.exe new file mode 100644 index 0000000..e2645f6 Binary files /dev/null and b/export/windows/neko/bin/Pet.GB.exe differ diff --git a/export/windows/neko/bin/assets/data/EarlyGameBoy.ttf b/export/windows/neko/bin/assets/data/EarlyGameBoy.ttf new file mode 100644 index 0000000..5cf4045 Binary files /dev/null and b/export/windows/neko/bin/assets/data/EarlyGameBoy.ttf differ diff --git a/export/windows/neko/bin/assets/icon.png b/export/windows/neko/bin/assets/icon.png new file mode 100644 index 0000000..13d7cc4 Binary files /dev/null and b/export/windows/neko/bin/assets/icon.png differ diff --git a/export/windows/neko/bin/assets/images/Cheer.png b/export/windows/neko/bin/assets/images/Cheer.png new file mode 100644 index 0000000..08660be Binary files /dev/null and b/export/windows/neko/bin/assets/images/Cheer.png differ diff --git a/export/windows/neko/bin/assets/images/Config.png b/export/windows/neko/bin/assets/images/Config.png new file mode 100644 index 0000000..591f3ad Binary files /dev/null and b/export/windows/neko/bin/assets/images/Config.png differ diff --git a/export/windows/neko/bin/assets/images/Egg.png b/export/windows/neko/bin/assets/images/Egg.png new file mode 100644 index 0000000..564a581 Binary files /dev/null and b/export/windows/neko/bin/assets/images/Egg.png differ diff --git a/export/windows/neko/bin/assets/images/Egg2.png b/export/windows/neko/bin/assets/images/Egg2.png new file mode 100644 index 0000000..ca700d1 Binary files /dev/null and b/export/windows/neko/bin/assets/images/Egg2.png differ diff --git a/export/windows/neko/bin/assets/images/Egg3.png b/export/windows/neko/bin/assets/images/Egg3.png new file mode 100644 index 0000000..5b31771 Binary files /dev/null and b/export/windows/neko/bin/assets/images/Egg3.png differ diff --git a/export/windows/neko/bin/assets/images/Feed.png b/export/windows/neko/bin/assets/images/Feed.png new file mode 100644 index 0000000..72034a7 Binary files /dev/null and b/export/windows/neko/bin/assets/images/Feed.png differ diff --git a/export/windows/neko/bin/assets/images/HUD_Background.png b/export/windows/neko/bin/assets/images/HUD_Background.png new file mode 100644 index 0000000..86963b3 Binary files /dev/null and b/export/windows/neko/bin/assets/images/HUD_Background.png differ diff --git a/export/windows/neko/bin/assets/images/Info.png b/export/windows/neko/bin/assets/images/Info.png new file mode 100644 index 0000000..301e713 Binary files /dev/null and b/export/windows/neko/bin/assets/images/Info.png differ diff --git a/export/windows/neko/bin/assets/images/Player.png b/export/windows/neko/bin/assets/images/Player.png new file mode 100644 index 0000000..ba34432 Binary files /dev/null and b/export/windows/neko/bin/assets/images/Player.png differ diff --git a/export/windows/neko/bin/assets/images/Rest.png b/export/windows/neko/bin/assets/images/Rest.png new file mode 100644 index 0000000..5ee7318 Binary files /dev/null and b/export/windows/neko/bin/assets/images/Rest.png differ diff --git a/export/windows/neko/bin/assets/images/Rest_old.png b/export/windows/neko/bin/assets/images/Rest_old.png new file mode 100644 index 0000000..a692945 Binary files /dev/null and b/export/windows/neko/bin/assets/images/Rest_old.png differ diff --git a/export/windows/neko/bin/assets/images/Scold.png b/export/windows/neko/bin/assets/images/Scold.png new file mode 100644 index 0000000..3752e8d Binary files /dev/null and b/export/windows/neko/bin/assets/images/Scold.png differ diff --git a/export/windows/neko/bin/assets/images/Train.png b/export/windows/neko/bin/assets/images/Train.png new file mode 100644 index 0000000..1bfe2ce Binary files /dev/null and b/export/windows/neko/bin/assets/images/Train.png differ diff --git a/export/windows/neko/bin/assets/images/Wipe.png b/export/windows/neko/bin/assets/images/Wipe.png new file mode 100644 index 0000000..5966a73 Binary files /dev/null and b/export/windows/neko/bin/assets/images/Wipe.png differ diff --git a/export/windows/neko/bin/assets/images/background.png b/export/windows/neko/bin/assets/images/background.png new file mode 100644 index 0000000..c2ff869 Binary files /dev/null and b/export/windows/neko/bin/assets/images/background.png differ diff --git a/export/windows/neko/bin/assets/images/tmp20.png b/export/windows/neko/bin/assets/images/tmp20.png new file mode 100644 index 0000000..fefcd82 Binary files /dev/null and b/export/windows/neko/bin/assets/images/tmp20.png differ diff --git a/export/windows/neko/bin/assets/images/tmp32.png b/export/windows/neko/bin/assets/images/tmp32.png new file mode 100644 index 0000000..8465184 Binary files /dev/null and b/export/windows/neko/bin/assets/images/tmp32.png differ diff --git a/export/windows/neko/bin/assets/images/tmpSelect.png b/export/windows/neko/bin/assets/images/tmpSelect.png new file mode 100644 index 0000000..f5ad6ce Binary files /dev/null and b/export/windows/neko/bin/assets/images/tmpSelect.png differ diff --git a/export/windows/neko/bin/assets/music/music-goes-here.txt b/export/windows/neko/bin/assets/music/music-goes-here.txt new file mode 100644 index 0000000..e69de29 diff --git a/export/windows/neko/bin/assets/sounds/Next.ogg b/export/windows/neko/bin/assets/sounds/Next.ogg new file mode 100644 index 0000000..5f7298e Binary files /dev/null and b/export/windows/neko/bin/assets/sounds/Next.ogg differ diff --git a/export/windows/neko/bin/assets/sounds/Select.ogg b/export/windows/neko/bin/assets/sounds/Select.ogg new file mode 100644 index 0000000..99fbf49 Binary files /dev/null and b/export/windows/neko/bin/assets/sounds/Select.ogg differ diff --git a/export/windows/neko/bin/gc.dll b/export/windows/neko/bin/gc.dll new file mode 100644 index 0000000..a78ce4c Binary files /dev/null and b/export/windows/neko/bin/gc.dll differ diff --git a/export/windows/neko/bin/icon.ico b/export/windows/neko/bin/icon.ico new file mode 100644 index 0000000..0ead8d1 Binary files /dev/null and b/export/windows/neko/bin/icon.ico differ diff --git a/export/windows/neko/bin/lime-legacy.ndll b/export/windows/neko/bin/lime-legacy.ndll new file mode 100644 index 0000000..f2f0bb5 Binary files /dev/null and b/export/windows/neko/bin/lime-legacy.ndll differ diff --git a/export/windows/neko/bin/manifest b/export/windows/neko/bin/manifest new file mode 100644 index 0000000..70fea90 --- /dev/null +++ b/export/windows/neko/bin/manifest @@ -0,0 +1 @@ +aoy4:pathy32:assets%2Fdata%2FEarlyGameBoy.ttfy4:typey4:FONTy2:idR1goR0y17:assets%2Ficon.pngR2y5:IMAGER4R5goR0y32:assets%2Fimages%2Fbackground.pngR2R6R4R7goR0y27:assets%2Fimages%2FCheer.pngR2R6R4R8goR0y28:assets%2Fimages%2FConfig.pngR2R6R4R9goR0y25:assets%2Fimages%2FEgg.pngR2R6R4R10goR0y26:assets%2Fimages%2FEgg2.pngR2R6R4R11goR0y26:assets%2Fimages%2FEgg3.pngR2R6R4R12goR0y26:assets%2Fimages%2FFeed.pngR2R6R4R13goR0y36:assets%2Fimages%2FHUD_Background.pngR2R6R4R14goR0y26:assets%2Fimages%2FInfo.pngR2R6R4R15goR0y28:assets%2Fimages%2FPlayer.pngR2R6R4R16goR0y26:assets%2Fimages%2FRest.pngR2R6R4R17goR0y30:assets%2Fimages%2FRest_old.pngR2R6R4R18goR0y27:assets%2Fimages%2FScold.pngR2R6R4R19goR0y27:assets%2Fimages%2Ftmp20.pngR2R6R4R20goR0y27:assets%2Fimages%2Ftmp32.pngR2R6R4R21goR0y31:assets%2Fimages%2FtmpSelect.pngR2R6R4R22goR0y27:assets%2Fimages%2FTrain.pngR2R6R4R23goR0y26:assets%2Fimages%2FWipe.pngR2R6R4R24goR0y36:assets%2Fmusic%2Fmusic-goes-here.txtR2y4:TEXTR4R25goR0y26:assets%2Fsounds%2FNext.oggR2y5:SOUNDR4R27goR0y28:assets%2Fsounds%2FSelect.oggR2R28R4R29goR0y26:flixel%2Fsounds%2Fbeep.oggR2R28R4R30goR0y28:flixel%2Fsounds%2Fflixel.oggR2R28R4R31goR0y30:flixel%2Ffonts%2Fnokiafc22.ttfR2R3R4R32goR0y31:flixel%2Ffonts%2Fmonsterrat.ttfR2R3R4R33goR0y33:flixel%2Fimages%2Fui%2Fbutton.pngR2R6R4R34gh \ No newline at end of file diff --git a/export/windows/neko/bin/neko.dll b/export/windows/neko/bin/neko.dll new file mode 100644 index 0000000..b0e07d0 Binary files /dev/null and b/export/windows/neko/bin/neko.dll differ diff --git a/export/windows/neko/bin/regexp.ndll b/export/windows/neko/bin/regexp.ndll new file mode 100644 index 0000000..1009ab5 Binary files /dev/null and b/export/windows/neko/bin/regexp.ndll differ diff --git a/export/windows/neko/bin/sqlite.ndll b/export/windows/neko/bin/sqlite.ndll new file mode 100644 index 0000000..b4c3ee8 Binary files /dev/null and b/export/windows/neko/bin/sqlite.ndll differ diff --git a/export/windows/neko/bin/std.ndll b/export/windows/neko/bin/std.ndll new file mode 100644 index 0000000..e9ec783 Binary files /dev/null and b/export/windows/neko/bin/std.ndll differ diff --git a/export/windows/neko/bin/zlib.ndll b/export/windows/neko/bin/zlib.ndll new file mode 100644 index 0000000..fc1b5d6 Binary files /dev/null and b/export/windows/neko/bin/zlib.ndll differ diff --git a/export/windows/neko/haxe/ApplicationMain.hx b/export/windows/neko/haxe/ApplicationMain.hx new file mode 100644 index 0000000..443b7f7 --- /dev/null +++ b/export/windows/neko/haxe/ApplicationMain.hx @@ -0,0 +1,657 @@ +#if !lime_hybrid + + +import openfl.Assets; + + +#if (!macro && !display && !waxe) + + +@:access(openfl._legacy.Assets) + + +class ApplicationMain { + + + private static var barA:flash.display.Sprite; + private static var barB:flash.display.Sprite; + private static var container:flash.display.Sprite; + private static var forceHeight:Int; + private static var forceWidth:Int; + + #if hxtelemetry + public static var telemetryConfig:hxtelemetry.HxTelemetry.Config; + #end + + + public static function main () { + + flash.Lib.setPackage ("Melon Bread", "Pet.GB", "com.example.myapp", "0.0.1"); + + + #if ios + flash.display.Stage.shouldRotateInterface = function (orientation:Int):Bool { + return (orientation == flash.display.Stage.OrientationLandscapeLeft || orientation == flash.display.Stage.OrientationLandscapeRight); + + } + #end + + #if hxtelemetry + telemetryConfig = new hxtelemetry.HxTelemetry.Config (); + telemetryConfig.allocations = true; + telemetryConfig.host = "localhost"; + telemetryConfig.app_name = "Pet.GB"; + #end + + + + #if tizen + flash.display.Stage.setFixedOrientation (flash.display.Stage.OrientationLandscapeRight); + #end + + flash.Lib.create (function () { + + flash.Lib.current.stage.align = flash.display.StageAlign.TOP_LEFT; + flash.Lib.current.stage.scaleMode = flash.display.StageScaleMode.NO_SCALE; + flash.Lib.current.loaderInfo = flash.display.LoaderInfo.create (null); + + #if mobile + + forceWidth = 160; + forceHeight = 144; + + container = new flash.display.Sprite (); + barA = new flash.display.Sprite (); + barB = new flash.display.Sprite (); + + flash.Lib.current.stage.addChild (container); + container.addChild (flash.Lib.current); + container.addChild (barA); + container.addChild (barB); + + applyScale (); + flash.Lib.current.stage.addEventListener (flash.events.Event.RESIZE, applyScale); + + #end + + #if windows + try { + + var currentPath = haxe.io.Path.directory (Sys.executablePath ()); + Sys.setCwd (currentPath); + + } catch (e:Dynamic) {} + #elseif linux + try { + + if (!sys.FileSystem.exists (Sys.getCwd () + "/lime-legacy.ndll")) { + + Sys.setCwd (haxe.io.Path.directory (Sys.executablePath ())); + + } + + } catch (e:Dynamic) {} + #end + + + + openfl.Assets.initialize (); + + var hasMain = false; + + for (methodName in Type.getClassFields (Main)) { + + if (methodName == "main") { + + hasMain = true; + break; + + } + + } + + if (hasMain) { + + Reflect.callMethod (Main, Reflect.field (Main, "main"), []); + + } else { + + var instance:DocumentClass = Type.createInstance (DocumentClass, []); + + if (Std.is (instance, flash.display.DisplayObject)) { + + flash.Lib.current.addChild (cast instance); + + } + + } + + }, + 160, 144, + 59, + 0, + (true ? flash.Lib.HARDWARE : 0) | + (true ? flash.Lib.ALLOW_SHADERS : 0) | + (false ? flash.Lib.REQUIRE_SHADERS : 0) | + (false ? flash.Lib.DEPTH_BUFFER : 0) | + (false ? flash.Lib.STENCIL_BUFFER : 0) | + (true ? flash.Lib.RESIZABLE : 0) | + (false ? flash.Lib.BORDERLESS : 0) | + (true ? flash.Lib.VSYNC : 0) | + (false ? flash.Lib.FULLSCREEN : 0) | + (0 == 4 ? flash.Lib.HW_AA_HIRES : 0) | + (0 == 2 ? flash.Lib.HW_AA : 0), + "Pet.GB", + null + #if mobile, ScaledStage #end + ); + + } + + #if mobile + public static function applyScale (?_) { + var scaledStage:ScaledStage = cast flash.Lib.current.stage; + + var xScale:Float = scaledStage.__stageWidth / forceWidth; + var yScale:Float = scaledStage.__stageHeight / forceHeight; + + if (xScale < yScale) { + + flash.Lib.current.scaleX = xScale; + flash.Lib.current.scaleY = xScale; + flash.Lib.current.x = (scaledStage.__stageWidth - (forceWidth * xScale)) / 2; + flash.Lib.current.y = (scaledStage.__stageHeight - (forceHeight * xScale)) / 2; + + } else { + + flash.Lib.current.scaleX = yScale; + flash.Lib.current.scaleY = yScale; + flash.Lib.current.x = (scaledStage.__stageWidth - (forceWidth * yScale)) / 2; + flash.Lib.current.y = (scaledStage.__stageHeight - (forceHeight * yScale)) / 2; + + } + + if (flash.Lib.current.x > 0) { + + barA.graphics.clear (); + barA.graphics.beginFill (0x000000); + barA.graphics.drawRect (0, 0, flash.Lib.current.x, scaledStage.__stageHeight); + + barB.graphics.clear (); + barB.graphics.beginFill (0x000000); + var x = flash.Lib.current.x + (forceWidth * flash.Lib.current.scaleX); + barB.graphics.drawRect (x, 0, scaledStage.__stageWidth - x, scaledStage.__stageHeight); + + } else { + + barA.graphics.clear (); + barA.graphics.beginFill (0x000000); + barA.graphics.drawRect (0, 0, scaledStage.__stageWidth, flash.Lib.current.y); + + barB.graphics.clear (); + barB.graphics.beginFill (0x000000); + var y = flash.Lib.current.y + (forceHeight * flash.Lib.current.scaleY); + barB.graphics.drawRect (0, y, scaledStage.__stageWidth, scaledStage.__stageHeight - y); + + } + + } + #end + + + #if neko + @:noCompletion @:dox(hide) public static function __init__ () { + + untyped $loader.path = $array (haxe.io.Path.directory (Sys.executablePath ()), $loader.path); + untyped $loader.path = $array ("./", $loader.path); + untyped $loader.path = $array ("@executable_path/", $loader.path); + + } + #end + + +} + + +@:build(DocumentClass.build()) +@:keep class DocumentClass extends Main {} + + +#if mobile +class ScaledStage extends flash.display.Stage { + + + public var __stageHeight (get, null):Int; + public var __stageWidth (get, null):Int; + + + public function new (inHandle:Dynamic, inWidth:Int, inHeight:Int) { + + super (inHandle, 0, 0); + + } + + + private function get___stageHeight ():Int { + + return super.get_stageHeight (); + + } + + + private function get___stageWidth():Int { + + return super.get_stageWidth (); + + } + + + private override function get_stageHeight ():Int { + + return 144; + + } + + private override function get_stageWidth ():Int { + + return 160; + + } + + +} +#end + + +#elseif macro + + +import haxe.macro.Context; +import haxe.macro.Expr; + + +class DocumentClass { + + + macro public static function build ():Array { + + var classType = Context.getLocalClass ().get (); + var searchTypes = classType; + + while (searchTypes.superClass != null) { + + if (searchTypes.pack.length >= 2 && (searchTypes.pack[1] == "display" || searchTypes.pack[2] == "display") && searchTypes.name == "DisplayObject") { + + var fields = Context.getBuildFields (); + var method = macro { return flash.Lib.current.stage; } + + fields.push ({ name: "get_stage", access: [ APrivate, AOverride ], kind: FFun({ args: [], expr: method, params: [], ret: macro :flash.display.Stage }), pos: Context.currentPos () }); + return fields; + + } + + searchTypes = searchTypes.superClass.t.get (); + + } + + return null; + + } + + +} + + +#elseif waxe + + +class ApplicationMain { + + + public static var autoShowFrame:Bool = true; + public static var frame:wx.Frame; + #if openfl + static public var nmeStage:wx.NMEStage; + #end + + + public static function main () { + + #if openfl + flash.Lib.setPackage ("Melon Bread", "Pet.GB", "com.example.myapp", "0.0.1"); + + #end + + wx.App.boot (function () { + + + frame = wx.Frame.create (null, null, "Pet.GB", null, { width: 160, height: 144 }); + + + #if openfl + var stage = wx.NMEStage.create (frame, null, null, { width: 160, height: 144 }); + #end + + var hasMain = false; + for (methodName in Type.getClassFields (Main)) { + if (methodName == "main") { + hasMain = true; + break; + } + } + + if (hasMain) { + Reflect.callMethod (Main, Reflect.field (Main, "main"), []); + }else { + var instance = Type.createInstance (Main, []); + } + + if (autoShowFrame) { + wx.App.setTopWindow (frame); + frame.shown = true; + } + + }); + + } + + #if neko + @:noCompletion @:dox(hide) public static function __init__ () { + + untyped $loader.path = $array (haxe.io.Path.directory (Sys.executablePath ()), $loader.path); + untyped $loader.path = $array ("./", $loader.path); + untyped $loader.path = $array ("@executable_path/", $loader.path); + + } + #end + + +} + + +#else + + +import Main; + +class ApplicationMain { + + + public static function main () { + + + + } + + +} + + +#end + + +#else + + +#if !macro + + +@:access(lime.app.Application) +@:access(lime.Assets) + + +class ApplicationMain { + + + public static var config:lime.app.Config; + public static var preloader:openfl.display.Preloader; + + + public static function create ():Void { + + var app = new lime.app.Application (); + app.create (config); + openfl.Lib.application = app; + + #if !flash + var stage = new openfl._legacy.display.HybridStage (app.window.width, app.window.height, app.window.config.background); + stage.addChild (openfl.Lib.current); + app.addModule (stage); + #end + + var display = new flixel.system.FlxPreloader (); + + preloader = new openfl.display.Preloader (display); + app.setPreloader (preloader); + preloader.onComplete.add (init); + preloader.create (config); + + #if (js && html5) + var urls = []; + var types = []; + + + urls.push ("flixel/sounds/beep.ogg"); + types.push (lime.Assets.AssetType.SOUND); + + + urls.push ("flixel/sounds/flixel.ogg"); + types.push (lime.Assets.AssetType.SOUND); + + + urls.push ("Nokia Cellphone FC Small"); + types.push (lime.Assets.AssetType.FONT); + + + urls.push ("Monsterrat"); + types.push (lime.Assets.AssetType.FONT); + + + urls.push ("flixel/images/ui/button.png"); + types.push (lime.Assets.AssetType.IMAGE); + + + + if (config.assetsPrefix != null) { + + for (i in 0...urls.length) { + + if (types[i] != lime.Assets.AssetType.FONT) { + + urls[i] = config.assetsPrefix + urls[i]; + + } + + } + + } + + preloader.load (urls, types); + #end + + var result = app.exec (); + + #if (sys && !nodejs && !emscripten) + Sys.exit (result); + #end + + } + + + public static function init ():Void { + + var loaded = 0; + var total = 0; + var library_onLoad = function (__) { + + loaded++; + + if (loaded == total) { + + start (); + + } + + } + + preloader = null; + + + + if (total == 0) { + + start (); + + } + + } + + + public static function main () { + + config = { + + build: "251", + company: "Melon Bread", + file: "Pet.GB", + fps: 59, + name: "Pet.GB", + orientation: "landscape", + packageName: "com.example.myapp", + version: "0.0.1", + windows: [ + + { + antialiasing: 0, + background: 0, + borderless: false, + depthBuffer: false, + display: 0, + fullscreen: false, + hardware: true, + height: 144, + parameters: "{}", + resizable: true, + stencilBuffer: false, + title: "Pet.GB", + vsync: true, + width: 160, + x: null, + y: null + }, + ] + + }; + + #if (js && html5) + #if (munit || utest) + openfl.Lib.embed (null, 160, 144, "null"); + #end + #else + create (); + #end + + } + + + public static function start ():Void { + + var hasMain = false; + var entryPoint = Type.resolveClass ("Main"); + + for (methodName in Type.getClassFields (entryPoint)) { + + if (methodName == "main") { + + hasMain = true; + break; + + } + + } + + lime.Assets.initialize (); + + if (hasMain) { + + Reflect.callMethod (entryPoint, Reflect.field (entryPoint, "main"), []); + + } else { + + var instance:DocumentClass = Type.createInstance (DocumentClass, []); + + if (Std.is (instance, flash.display.DisplayObject)) { + + flash.Lib.current.addChild (cast instance); + + } + + } + + openfl.Lib.current.stage.dispatchEvent (new openfl.events.Event (openfl.events.Event.RESIZE, false, false)); + + } + + + #if neko + @:noCompletion @:dox(hide) public static function __init__ () { + + var loader = new neko.vm.Loader (untyped $loader); + loader.addPath (haxe.io.Path.directory (Sys.executablePath ())); + loader.addPath ("./"); + loader.addPath ("@executable_path/"); + + } + #end + + +} + + +@:build(DocumentClass.build()) +@:keep class DocumentClass extends Main {} + + +#else + + +import haxe.macro.Context; +import haxe.macro.Expr; + + +class DocumentClass { + + + macro public static function build ():Array { + + var classType = Context.getLocalClass ().get (); + var searchTypes = classType; + + while (searchTypes.superClass != null) { + + if (searchTypes.pack.length >= 2 && (searchTypes.pack[1] == "display" || searchTypes.pack[2] == "display") && searchTypes.name == "DisplayObject") { + + var fields = Context.getBuildFields (); + var method = macro { return flash.Lib.current.stage; } + + fields.push ({ name: "get_stage", access: [ APrivate, AOverride ], kind: FFun({ args: [], expr: method, params: [], ret: macro :flash.display.Stage }), pos: Context.currentPos () }); + return fields; + + } + + searchTypes = searchTypes.superClass.t.get (); + + } + + return null; + + } + + +} + + +#end + + +#end diff --git a/export/windows/neko/haxe/DefaultAssetLibrary.hx b/export/windows/neko/haxe/DefaultAssetLibrary.hx new file mode 100644 index 0000000..d3ef79a --- /dev/null +++ b/export/windows/neko/haxe/DefaultAssetLibrary.hx @@ -0,0 +1,1663 @@ +#if !lime_hybrid + + +package; + + +import haxe.Timer; +import haxe.Unserializer; +import openfl.display.Bitmap; +import openfl.display.BitmapData; +import openfl.display.MovieClip; +import openfl.events.Event; +import openfl.text.Font; +import openfl.media.Sound; +import openfl.net.URLRequest; +import openfl.utils.ByteArray; +import openfl.Assets; + +#if neko +import neko.vm.Deque; +import neko.vm.Thread; +#elseif cpp +import cpp.vm.Deque; +import cpp.vm.Thread; +#end + +#if sys +import sys.FileSystem; +#end + +#if ios +import openfl._legacy.utils.SystemPath; +#end + + +@:access(openfl.media.Sound) +class DefaultAssetLibrary extends AssetLibrary { + + + private static var loaded = 0; + private static var loading = 0; + private static var workerIncomingQueue = new Deque (); + private static var workerResult = new Deque (); + private static var workerThread:Thread; + + public var className (default, null) = new Map (); + public var path (default, null) = new Map (); + public var type (default, null) = new Map (); + + private var lastModified:Float; + private var timer:Timer; + + + public function new () { + + super (); + + + Font.registerFont (__ASSET__assets_data_earlygameboy_ttf); + + + + + + + + + + + + + + + + + + + + + + + + + Font.registerFont (__ASSET__flixel_fonts_nokiafc22_ttf); + Font.registerFont (__ASSET__flixel_fonts_monsterrat_ttf); + + + + #if (windows || mac || linux) + + var useManifest = false; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + + className.set ("flixel/sounds/beep.ogg", __ASSET__flixel_sounds_beep_ogg); + type.set ("flixel/sounds/beep.ogg", AssetType.SOUND); + + className.set ("flixel/sounds/flixel.ogg", __ASSET__flixel_sounds_flixel_ogg); + type.set ("flixel/sounds/flixel.ogg", AssetType.SOUND); + + className.set ("flixel/fonts/nokiafc22.ttf", __ASSET__flixel_fonts_nokiafc22_ttf); + type.set ("flixel/fonts/nokiafc22.ttf", AssetType.FONT); + + className.set ("flixel/fonts/monsterrat.ttf", __ASSET__flixel_fonts_monsterrat_ttf); + type.set ("flixel/fonts/monsterrat.ttf", AssetType.FONT); + + className.set ("flixel/images/ui/button.png", __ASSET__flixel_images_ui_button_png); + type.set ("flixel/images/ui/button.png", AssetType.IMAGE); + + + if (useManifest) { + + loadManifest (); + + if (Sys.args ().indexOf ("-livereload") > -1) { + + var path = FileSystem.fullPath ("manifest"); + lastModified = FileSystem.stat (path).mtime.getTime (); + + timer = new Timer (2000); + timer.run = function () { + + var modified = FileSystem.stat (path).mtime.getTime (); + + if (modified > lastModified) { + + lastModified = modified; + loadManifest (); + + if (eventCallback != null) { + + eventCallback (this, "change"); + + } + + } + + } + + } + + } + + #else + + loadManifest (); + + #end + + } + + + public override function exists (id:String, type:AssetType):Bool { + + var assetType = this.type.get (id); + + if (assetType != null) { + + if (assetType == type || ((type == SOUND || type == MUSIC) && (assetType == MUSIC || assetType == SOUND))) { + + return true; + + } + + if (type == BINARY || type == null || (assetType == BINARY && type == TEXT)) { + + return true; + + } + + } + + return false; + + } + + + public override function getBitmapData (id:String):BitmapData { + + if (className.exists (id)) { + + return cast (Type.createInstance (className.get (id), []), BitmapData); + + } else { + + return BitmapData.load (path.get (id)); + + } + + } + + + public override function getBytes (id:String):ByteArray { + + if (className.exists (id)) { + + return cast (Type.createInstance (className.get (id), []), ByteArray); + + } else { + + return ByteArray.readFile (path.get (id)); + + } + + } + + + public override function getFont (id:String):Font { + + if (className.exists (id)) { + + var fontClass = className.get (id); + Font.registerFont (fontClass); + return cast (Type.createInstance (fontClass, []), Font); + + } else { + + return new Font (path.get (id)); + + } + + } + + + public override function getMusic (id:String):Sound { + + if (className.exists (id)) { + + return cast (Type.createInstance (className.get (id), []), Sound); + + } else { + + return new Sound (new URLRequest (path.get (id)), null, true); + + } + + } + + + public override function getPath (id:String):String { + + #if ios + + return SystemPath.applicationDirectory + "/assets/" + path.get (id); + + #else + + return path.get (id); + + #end + + } + + + public override function getSound (id:String):Sound { + + if (className.exists (id)) { + + return cast (Type.createInstance (className.get (id), []), Sound); + + } else { + + return new Sound (new URLRequest (path.get (id)), null, type.get (id) == MUSIC); + + } + + } + + + public override function getText (id:String):String { + + var bytes = getBytes (id); + + if (bytes == null) { + + return null; + + } else { + + return bytes.readUTFBytes (bytes.length); + + } + + } + + + public override function isLocal (id:String, type:AssetType):Bool { + + return true; + + } + + + public override function list (type:AssetType):Array { + + var items = []; + + for (id in this.type.keys ()) { + + if (type == null || exists (id, type)) { + + items.push (id); + + } + + } + + return items; + + } + + + public override function loadBitmapData (id:String, handler:BitmapData -> Void):Void { + + __load (getBitmapData, id, handler); + + } + + + public override function loadBytes (id:String, handler:ByteArray -> Void):Void { + + __load (getBytes, id, handler); + + } + + + public override function loadFont (id:String, handler:Font -> Void):Void { + + __load (getFont, id, handler); + + } + + + private function loadManifest ():Void { + + try { + + #if blackberry + var bytes = ByteArray.readFile ("app/native/manifest"); + #elseif tizen + var bytes = ByteArray.readFile ("../res/manifest"); + #elseif emscripten + var bytes = ByteArray.readFile ("assets/manifest"); + #else + var bytes = ByteArray.readFile ("manifest"); + #end + + if (bytes != null) { + + bytes.position = 0; + + if (bytes.length > 0) { + + var data = bytes.readUTFBytes (bytes.length); + + if (data != null && data.length > 0) { + + var manifest:Array = Unserializer.run (data); + + for (asset in manifest) { + + if (!className.exists (asset.id)) { + + path.set (asset.id, asset.path); + type.set (asset.id, Type.createEnum (AssetType, asset.type)); + + } + + } + + } + + } + + } else { + + trace ("Warning: Could not load asset manifest (bytes was null)"); + + } + + } catch (e:Dynamic) { + + trace ('Warning: Could not load asset manifest (${e})'); + + } + + } + + + public override function loadMusic (id:String, handler:Sound -> Void):Void { + + __load (getMusic, id, handler); + + } + + + public override function loadSound (id:String, handler:Sound -> Void):Void { + + __load (getSound, id, handler); + + } + + + public override function loadText (id:String, handler:String -> Void):Void { + + var callback = function (bytes:ByteArray):Void { + + if (bytes == null) { + + handler (null); + + } else { + + handler (bytes.readUTFBytes (bytes.length)); + + } + + } + + loadBytes (id, callback); + + } + + + private static function __doWork ():Void { + + while (true) { + + var message = workerIncomingQueue.pop (true); + + if (message == "WORK") { + + var getMethod = workerIncomingQueue.pop (true); + var id = workerIncomingQueue.pop (true); + var handler = workerIncomingQueue.pop (true); + + var data = getMethod (id); + workerResult.add ("RESULT"); + workerResult.add (data); + workerResult.add (handler); + + } else if (message == "EXIT") { + + break; + + } + + } + + } + + + private inline function __load (getMethod:String->T, id:String, handler:T->Void):Void { + + workerIncomingQueue.add ("WORK"); + workerIncomingQueue.add (getMethod); + workerIncomingQueue.add (id); + workerIncomingQueue.add (handler); + + loading++; + + } + + + public static function __poll ():Void { + + if (loading > loaded) { + + if (workerThread == null) { + + workerThread = Thread.create (__doWork); + + } + + var message = workerResult.pop (false); + + while (message == "RESULT") { + + loaded++; + + var data = workerResult.pop (true); + var handler = workerResult.pop (true); + + if (handler != null) { + + handler (data); + + } + + message = workerResult.pop (false); + + } + + } else { + + if (workerThread != null) { + + workerIncomingQueue.add ("EXIT"); + workerThread = null; + + } + + } + + } + + +} + + +#if (windows || mac || linux) + + +@:sound("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/sounds/beep.ogg") @:keep #if display private #end class __ASSET__flixel_sounds_beep_ogg extends flash.media.Sound {} +@:sound("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/sounds/flixel.ogg") @:keep #if display private #end class __ASSET__flixel_sounds_flixel_ogg extends flash.media.Sound {} +@:font("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/fonts/nokiafc22.ttf") @:keep #if display private #end class __ASSET__flixel_fonts_nokiafc22_ttf extends flash.text.Font {} +@:font("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/fonts/monsterrat.ttf") @:keep #if display private #end class __ASSET__flixel_fonts_monsterrat_ttf extends flash.text.Font {} +@:bitmap("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/images/ui/button.png") @:keep #if display private #end class __ASSET__flixel_images_ui_button_png extends flash.display.BitmapData {} + + + +@:keep class __ASSET__assets_data_earlygameboy_ttf extends openfl.text.Font { public function new () { super (); __fontPath = "assets/data/EarlyGameBoy.ttf"; fontName = "Early GameBoy Regular"; }} + + +#else + + +class __ASSET__assets_data_earlygameboy_ttf extends openfl.text.Font { public function new () { super (); __fontPath = "assets/data/EarlyGameBoy.ttf"; fontName = "Early GameBoy Regular"; }} +class __ASSET__flixel_fonts_nokiafc22_ttf extends openfl.text.Font { public function new () { super (); __fontPath = "flixel/fonts/nokiafc22.ttf"; fontName = "Nokia Cellphone FC Small"; }} +class __ASSET__flixel_fonts_monsterrat_ttf extends openfl.text.Font { public function new () { super (); __fontPath = "flixel/fonts/monsterrat.ttf"; fontName = "Monsterrat"; }} + + +#end + + +#else + + +package; + + +import haxe.Timer; +import haxe.Unserializer; +import lime.app.Future; +import lime.app.Preloader; +import lime.app.Promise; +import lime.audio.AudioSource; +import lime.audio.openal.AL; +import lime.audio.AudioBuffer; +import lime.graphics.Image; +import lime.text.Font; +import lime.utils.ByteArray; +import lime.utils.UInt8Array; +import lime.Assets; + +#if sys +import sys.FileSystem; +#end + +#if (js && html5) +import lime.net.URLLoader; +import lime.net.URLRequest; +#elseif flash +import flash.display.Bitmap; +import flash.display.BitmapData; +import flash.display.Loader; +import flash.events.Event; +import flash.events.IOErrorEvent; +import flash.events.ProgressEvent; +import flash.media.Sound; +import flash.net.URLLoader; +import flash.net.URLRequest; +#end + + +class DefaultAssetLibrary extends AssetLibrary { + + + public var className (default, null) = new Map (); + public var path (default, null) = new Map (); + public var type (default, null) = new Map (); + + private var lastModified:Float; + private var timer:Timer; + + + public function new () { + + super (); + + #if (openfl && !flash) + + openfl.text.Font.registerFont (__ASSET__OPENFL__assets_data_earlygameboy_ttf); + + + + + + + + + + + + + + + + + + + + + + + + + openfl.text.Font.registerFont (__ASSET__OPENFL__flixel_fonts_nokiafc22_ttf); + openfl.text.Font.registerFont (__ASSET__OPENFL__flixel_fonts_monsterrat_ttf); + + + #end + + #if flash + + path.set ("assets/data/EarlyGameBoy.ttf", "assets/data/EarlyGameBoy.ttf"); + type.set ("assets/data/EarlyGameBoy.ttf", AssetType.FONT); + path.set ("assets/icon.png", "assets/icon.png"); + type.set ("assets/icon.png", AssetType.IMAGE); + path.set ("assets/images/background.png", "assets/images/background.png"); + type.set ("assets/images/background.png", AssetType.IMAGE); + path.set ("assets/images/Cheer.png", "assets/images/Cheer.png"); + type.set ("assets/images/Cheer.png", AssetType.IMAGE); + path.set ("assets/images/Config.png", "assets/images/Config.png"); + type.set ("assets/images/Config.png", AssetType.IMAGE); + path.set ("assets/images/Egg.png", "assets/images/Egg.png"); + type.set ("assets/images/Egg.png", AssetType.IMAGE); + path.set ("assets/images/Egg2.png", "assets/images/Egg2.png"); + type.set ("assets/images/Egg2.png", AssetType.IMAGE); + path.set ("assets/images/Egg3.png", "assets/images/Egg3.png"); + type.set ("assets/images/Egg3.png", AssetType.IMAGE); + path.set ("assets/images/Feed.png", "assets/images/Feed.png"); + type.set ("assets/images/Feed.png", AssetType.IMAGE); + path.set ("assets/images/HUD_Background.png", "assets/images/HUD_Background.png"); + type.set ("assets/images/HUD_Background.png", AssetType.IMAGE); + path.set ("assets/images/Info.png", "assets/images/Info.png"); + type.set ("assets/images/Info.png", AssetType.IMAGE); + path.set ("assets/images/Player.png", "assets/images/Player.png"); + type.set ("assets/images/Player.png", AssetType.IMAGE); + path.set ("assets/images/Rest.png", "assets/images/Rest.png"); + type.set ("assets/images/Rest.png", AssetType.IMAGE); + path.set ("assets/images/Rest_old.png", "assets/images/Rest_old.png"); + type.set ("assets/images/Rest_old.png", AssetType.IMAGE); + path.set ("assets/images/Scold.png", "assets/images/Scold.png"); + type.set ("assets/images/Scold.png", AssetType.IMAGE); + path.set ("assets/images/tmp20.png", "assets/images/tmp20.png"); + type.set ("assets/images/tmp20.png", AssetType.IMAGE); + path.set ("assets/images/tmp32.png", "assets/images/tmp32.png"); + type.set ("assets/images/tmp32.png", AssetType.IMAGE); + path.set ("assets/images/tmpSelect.png", "assets/images/tmpSelect.png"); + type.set ("assets/images/tmpSelect.png", AssetType.IMAGE); + path.set ("assets/images/Train.png", "assets/images/Train.png"); + type.set ("assets/images/Train.png", AssetType.IMAGE); + path.set ("assets/images/Wipe.png", "assets/images/Wipe.png"); + type.set ("assets/images/Wipe.png", AssetType.IMAGE); + path.set ("assets/music/music-goes-here.txt", "assets/music/music-goes-here.txt"); + type.set ("assets/music/music-goes-here.txt", AssetType.TEXT); + path.set ("assets/sounds/Next.ogg", "assets/sounds/Next.ogg"); + type.set ("assets/sounds/Next.ogg", AssetType.SOUND); + path.set ("assets/sounds/Select.ogg", "assets/sounds/Select.ogg"); + type.set ("assets/sounds/Select.ogg", AssetType.SOUND); + className.set ("flixel/sounds/beep.ogg", __ASSET__flixel_sounds_beep_ogg); + type.set ("flixel/sounds/beep.ogg", AssetType.SOUND); + className.set ("flixel/sounds/flixel.ogg", __ASSET__flixel_sounds_flixel_ogg); + type.set ("flixel/sounds/flixel.ogg", AssetType.SOUND); + className.set ("flixel/fonts/nokiafc22.ttf", __ASSET__flixel_fonts_nokiafc22_ttf); + type.set ("flixel/fonts/nokiafc22.ttf", AssetType.FONT); + className.set ("flixel/fonts/monsterrat.ttf", __ASSET__flixel_fonts_monsterrat_ttf); + type.set ("flixel/fonts/monsterrat.ttf", AssetType.FONT); + className.set ("flixel/images/ui/button.png", __ASSET__flixel_images_ui_button_png); + type.set ("flixel/images/ui/button.png", AssetType.IMAGE); + + + #elseif html5 + + var id; + id = "assets/data/EarlyGameBoy.ttf"; + path.set (id, id); + type.set (id, AssetType.FONT); + id = "assets/icon.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/background.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Cheer.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Config.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Egg.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Egg2.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Egg3.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Feed.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/HUD_Background.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Info.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Player.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Rest.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Rest_old.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Scold.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/tmp20.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/tmp32.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/tmpSelect.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Train.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/images/Wipe.png"; + path.set (id, id); + type.set (id, AssetType.IMAGE); + id = "assets/music/music-goes-here.txt"; + path.set (id, id); + type.set (id, AssetType.TEXT); + id = "assets/sounds/Next.ogg"; + path.set (id, id); + type.set (id, AssetType.SOUND); + id = "assets/sounds/Select.ogg"; + path.set (id, id); + type.set (id, AssetType.SOUND); + id = "flixel/sounds/beep.ogg"; + path.set (id, id); + + type.set (id, AssetType.SOUND); + id = "flixel/sounds/flixel.ogg"; + path.set (id, id); + + type.set (id, AssetType.SOUND); + id = "flixel/fonts/nokiafc22.ttf"; + className.set (id, __ASSET__flixel_fonts_nokiafc22_ttf); + + type.set (id, AssetType.FONT); + id = "flixel/fonts/monsterrat.ttf"; + className.set (id, __ASSET__flixel_fonts_monsterrat_ttf); + + type.set (id, AssetType.FONT); + id = "flixel/images/ui/button.png"; + path.set (id, id); + + type.set (id, AssetType.IMAGE); + + + var assetsPrefix = null; + if (ApplicationMain.config != null && Reflect.hasField (ApplicationMain.config, "assetsPrefix")) { + assetsPrefix = ApplicationMain.config.assetsPrefix; + } + if (assetsPrefix != null) { + for (k in path.keys()) { + path.set(k, assetsPrefix + path[k]); + } + } + + #else + + #if (windows || mac || linux) + + var useManifest = false; + + className.set ("assets/data/EarlyGameBoy.ttf", __ASSET__assets_data_earlygameboy_ttf); + type.set ("assets/data/EarlyGameBoy.ttf", AssetType.FONT); + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + useManifest = true; + + className.set ("flixel/sounds/beep.ogg", __ASSET__flixel_sounds_beep_ogg); + type.set ("flixel/sounds/beep.ogg", AssetType.SOUND); + + className.set ("flixel/sounds/flixel.ogg", __ASSET__flixel_sounds_flixel_ogg); + type.set ("flixel/sounds/flixel.ogg", AssetType.SOUND); + + className.set ("flixel/fonts/nokiafc22.ttf", __ASSET__flixel_fonts_nokiafc22_ttf); + type.set ("flixel/fonts/nokiafc22.ttf", AssetType.FONT); + + className.set ("flixel/fonts/monsterrat.ttf", __ASSET__flixel_fonts_monsterrat_ttf); + type.set ("flixel/fonts/monsterrat.ttf", AssetType.FONT); + + className.set ("flixel/images/ui/button.png", __ASSET__flixel_images_ui_button_png); + type.set ("flixel/images/ui/button.png", AssetType.IMAGE); + + + if (useManifest) { + + loadManifest (); + + if (Sys.args ().indexOf ("-livereload") > -1) { + + var path = FileSystem.fullPath ("manifest"); + lastModified = FileSystem.stat (path).mtime.getTime (); + + timer = new Timer (2000); + timer.run = function () { + + var modified = FileSystem.stat (path).mtime.getTime (); + + if (modified > lastModified) { + + lastModified = modified; + loadManifest (); + + onChange.dispatch (); + + } + + } + + } + + } + + #else + + loadManifest (); + + #end + #end + + } + + + public override function exists (id:String, type:String):Bool { + + var requestedType = type != null ? cast (type, AssetType) : null; + var assetType = this.type.get (id); + + if (assetType != null) { + + if (assetType == requestedType || ((requestedType == SOUND || requestedType == MUSIC) && (assetType == MUSIC || assetType == SOUND))) { + + return true; + + } + + #if flash + + if (requestedType == BINARY && (assetType == BINARY || assetType == TEXT || assetType == IMAGE)) { + + return true; + + } else if (requestedType == null || path.exists (id)) { + + return true; + + } + + #else + + if (requestedType == BINARY || requestedType == null || (assetType == BINARY && requestedType == TEXT)) { + + return true; + + } + + #end + + } + + return false; + + } + + + public override function getAudioBuffer (id:String):AudioBuffer { + + #if flash + + var buffer = new AudioBuffer (); + buffer.src = cast (Type.createInstance (className.get (id), []), Sound); + return buffer; + + #elseif html5 + + return null; + //return new Sound (new URLRequest (path.get (id))); + + #else + + if (className.exists(id)) return AudioBuffer.fromBytes (cast (Type.createInstance (className.get (id), []), ByteArray)); + else return AudioBuffer.fromFile (path.get (id)); + + #end + + } + + + public override function getBytes (id:String):ByteArray { + + #if flash + + switch (type.get (id)) { + + case TEXT, BINARY: + + return cast (Type.createInstance (className.get (id), []), ByteArray); + + case IMAGE: + + var bitmapData = cast (Type.createInstance (className.get (id), []), BitmapData); + return bitmapData.getPixels (bitmapData.rect); + + default: + + return null; + + } + + return cast (Type.createInstance (className.get (id), []), ByteArray); + + #elseif html5 + + var bytes:ByteArray = null; + var loader = Preloader.loaders.get (path.get (id)); + + if (loader == null) { + + return null; + + } + + var data = loader.data; + + if (Std.is (data, String)) { + + bytes = new ByteArray (); + bytes.writeUTFBytes (data); + + } else if (Std.is (data, ByteArray)) { + + bytes = cast data; + + } else { + + bytes = null; + + } + + if (bytes != null) { + + bytes.position = 0; + return bytes; + + } else { + + return null; + } + + #else + + if (className.exists(id)) return cast (Type.createInstance (className.get (id), []), ByteArray); + else return ByteArray.readFile (path.get (id)); + + #end + + } + + + public override function getFont (id:String):Font { + + #if flash + + var src = Type.createInstance (className.get (id), []); + + var font = new Font (src.fontName); + font.src = src; + return font; + + #elseif html5 + + return cast (Type.createInstance (className.get (id), []), Font); + + #else + + if (className.exists (id)) { + + var fontClass = className.get (id); + return cast (Type.createInstance (fontClass, []), Font); + + } else { + + return Font.fromFile (path.get (id)); + + } + + #end + + } + + + public override function getImage (id:String):Image { + + #if flash + + return Image.fromBitmapData (cast (Type.createInstance (className.get (id), []), BitmapData)); + + #elseif html5 + + return Image.fromImageElement (Preloader.images.get (path.get (id))); + + #else + + if (className.exists (id)) { + + var fontClass = className.get (id); + return cast (Type.createInstance (fontClass, []), Image); + + } else { + + return Image.fromFile (path.get (id)); + + } + + #end + + } + + + /*public override function getMusic (id:String):Dynamic { + + #if flash + + return cast (Type.createInstance (className.get (id), []), Sound); + + #elseif openfl_html5 + + //var sound = new Sound (); + //sound.__buffer = true; + //sound.load (new URLRequest (path.get (id))); + //return sound; + return null; + + #elseif html5 + + return null; + //return new Sound (new URLRequest (path.get (id))); + + #else + + return null; + //if (className.exists(id)) return cast (Type.createInstance (className.get (id), []), Sound); + //else return new Sound (new URLRequest (path.get (id)), null, true); + + #end + + }*/ + + + public override function getPath (id:String):String { + + //#if ios + + //return SystemPath.applicationDirectory + "/assets/" + path.get (id); + + //#else + + return path.get (id); + + //#end + + } + + + public override function getText (id:String):String { + + #if html5 + + var bytes:ByteArray = null; + var loader = Preloader.loaders.get (path.get (id)); + + if (loader == null) { + + return null; + + } + + var data = loader.data; + + if (Std.is (data, String)) { + + return cast data; + + } else if (Std.is (data, ByteArray)) { + + bytes = cast data; + + } else { + + bytes = null; + + } + + if (bytes != null) { + + bytes.position = 0; + return bytes.readUTFBytes (bytes.length); + + } else { + + return null; + } + + #else + + var bytes = getBytes (id); + + if (bytes == null) { + + return null; + + } else { + + return bytes.readUTFBytes (bytes.length); + + } + + #end + + } + + + public override function isLocal (id:String, type:String):Bool { + + var requestedType = type != null ? cast (type, AssetType) : null; + + #if flash + + //if (requestedType != AssetType.MUSIC && requestedType != AssetType.SOUND) { + + return className.exists (id); + + //} + + #end + + return true; + + } + + + public override function list (type:String):Array { + + var requestedType = type != null ? cast (type, AssetType) : null; + var items = []; + + for (id in this.type.keys ()) { + + if (requestedType == null || exists (id, type)) { + + items.push (id); + + } + + } + + return items; + + } + + + public override function loadAudioBuffer (id:String):Future { + + var promise = new Promise (); + + #if (flash) + + if (path.exists (id)) { + + var soundLoader = new Sound (); + soundLoader.addEventListener (Event.COMPLETE, function (event) { + + var audioBuffer:AudioBuffer = new AudioBuffer(); + audioBuffer.src = event.currentTarget; + promise.complete (audioBuffer); + + }); + soundLoader.addEventListener (ProgressEvent.PROGRESS, function (event) { + + if (event.bytesTotal == 0) { + + promise.progress (0); + + } else { + + promise.progress (event.bytesLoaded / event.bytesTotal); + + } + + }); + soundLoader.addEventListener (IOErrorEvent.IO_ERROR, promise.error); + soundLoader.load (new URLRequest (path.get (id))); + + } else { + + promise.complete (getAudioBuffer (id)); + + } + + #else + + promise.completeWith (new Future (function () return getAudioBuffer (id))); + + #end + + return promise.future; + + } + + + public override function loadBytes (id:String):Future { + + var promise = new Promise (); + + #if flash + + if (path.exists (id)) { + + var loader = new URLLoader (); + loader.addEventListener (Event.COMPLETE, function (event:Event) { + + var bytes = new ByteArray (); + bytes.writeUTFBytes (event.currentTarget.data); + bytes.position = 0; + + promise.complete (bytes); + + }); + loader.addEventListener (ProgressEvent.PROGRESS, function (event) { + + if (event.bytesTotal == 0) { + + promise.progress (0); + + } else { + + promise.progress (event.bytesLoaded / event.bytesTotal); + + } + + }); + loader.addEventListener (IOErrorEvent.IO_ERROR, promise.error); + loader.load (new URLRequest (path.get (id))); + + } else { + + promise.complete (getBytes (id)); + + } + + #elseif html5 + + if (path.exists (id)) { + + var loader = new URLLoader (); + loader.dataFormat = BINARY; + loader.onComplete.add (function (_):Void { + + promise.complete (loader.data); + + }); + loader.onProgress.add (function (_, loaded, total) { + + if (total == 0) { + + promise.progress (0); + + } else { + + promise.progress (loaded / total); + + } + + }); + loader.onIOError.add (function (_, e) { + + promise.error (e); + + }); + loader.load (new URLRequest (path.get (id))); + + } else { + + promise.complete (getBytes (id)); + + } + + #else + + promise.completeWith (new Future (function () return getBytes (id))); + + #end + + return promise.future; + + } + + + public override function loadImage (id:String):Future { + + var promise = new Promise (); + + #if flash + + if (path.exists (id)) { + + var loader = new Loader (); + loader.contentLoaderInfo.addEventListener (Event.COMPLETE, function (event:Event) { + + var bitmapData = cast (event.currentTarget.content, Bitmap).bitmapData; + promise.complete (Image.fromBitmapData (bitmapData)); + + }); + loader.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, function (event) { + + if (event.bytesTotal == 0) { + + promise.progress (0); + + } else { + + promise.progress (event.bytesLoaded / event.bytesTotal); + + } + + }); + loader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, promise.error); + loader.load (new URLRequest (path.get (id))); + + } else { + + promise.complete (getImage (id)); + + } + + #elseif html5 + + if (path.exists (id)) { + + var image = new js.html.Image (); + image.onload = function (_):Void { + + promise.complete (Image.fromImageElement (image)); + + } + image.onerror = promise.error; + image.src = path.get (id); + + } else { + + promise.complete (getImage (id)); + + } + + #else + + promise.completeWith (new Future (function () return getImage (id))); + + #end + + return promise.future; + + } + + + #if (!flash && !html5) + private function loadManifest ():Void { + + try { + + #if blackberry + var bytes = ByteArray.readFile ("app/native/manifest"); + #elseif tizen + var bytes = ByteArray.readFile ("../res/manifest"); + #elseif emscripten + var bytes = ByteArray.readFile ("assets/manifest"); + #elseif (mac && java) + var bytes = ByteArray.readFile ("../Resources/manifest"); + #elseif ios + var bytes = ByteArray.readFile ("assets/manifest"); + #else + var bytes = ByteArray.readFile ("manifest"); + #end + + if (bytes != null) { + + bytes.position = 0; + + if (bytes.length > 0) { + + var data = bytes.readUTFBytes (bytes.length); + + if (data != null && data.length > 0) { + + var manifest:Array = Unserializer.run (data); + + for (asset in manifest) { + + if (!className.exists (asset.id)) { + + #if ios + path.set (asset.id, "assets/" + asset.path); + #else + path.set (asset.id, asset.path); + #end + type.set (asset.id, cast (asset.type, AssetType)); + + } + + } + + } + + } + + } else { + + trace ("Warning: Could not load asset manifest (bytes was null)"); + + } + + } catch (e:Dynamic) { + + trace ('Warning: Could not load asset manifest (${e})'); + + } + + } + #end + + + public override function loadText (id:String):Future { + + var promise = new Promise (); + + #if html5 + + if (path.exists (id)) { + + var loader = new URLLoader (); + loader.onComplete.add (function (_):Void { + + promise.complete (loader.data); + + }); + loader.onProgress.add (function (_, loaded, total) { + + if (total == 0) { + + promise.progress (0); + + } else { + + promise.progress (loaded / total); + + } + + }); + loader.onIOError.add (function (_, msg) promise.error (msg)); + loader.load (new URLRequest (path.get (id))); + + } else { + + promise.complete (getText (id)); + + } + + #else + + promise.completeWith (loadBytes (id).then (function (bytes) { + + return new Future (function () { + + if (bytes == null) { + + return null; + + } else { + + return bytes.readUTFBytes (bytes.length); + + } + + }); + + })); + + #end + + return promise.future; + + } + + +} + + +#if !display +#if flash + + + + + + + + + + + + + + + + + + + + + + + + +@:keep @:bind #if display private #end class __ASSET__flixel_sounds_beep_ogg extends null { } +@:keep @:bind #if display private #end class __ASSET__flixel_sounds_flixel_ogg extends null { } +@:keep @:bind #if display private #end class __ASSET__flixel_fonts_nokiafc22_ttf extends null { } +@:keep @:bind #if display private #end class __ASSET__flixel_fonts_monsterrat_ttf extends null { } +@:keep @:bind #if display private #end class __ASSET__flixel_images_ui_button_png extends flash.display.BitmapData { public function new () { super (0, 0, true, 0); } } + + +#elseif html5 + +@:keep #if display private #end class __ASSET__assets_data_earlygameboy_ttf extends lime.text.Font { public function new () { super (); name = "Early GameBoy Regular"; } } + + + + + + + + + + + + + + + + + + + + + + + + +@:keep #if display private #end class __ASSET__flixel_fonts_nokiafc22_ttf extends lime.text.Font { public function new () { super (); name = "Nokia Cellphone FC Small"; } } +@:keep #if display private #end class __ASSET__flixel_fonts_monsterrat_ttf extends lime.text.Font { public function new () { super (); name = "Monsterrat"; } } + + + +#else + +@:keep #if display private #end class __ASSET__assets_data_earlygameboy_ttf extends lime.text.Font { public function new () { __fontPath = #if ios "assets/" + #end "assets/data/EarlyGameBoy.ttf"; name = "Early GameBoy Regular"; super (); }} + + +#if (windows || mac || linux || cpp) + + +@:file("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/sounds/beep.ogg") #if display private #end class __ASSET__flixel_sounds_beep_ogg extends lime.utils.ByteArray {} +@:file("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/sounds/flixel.ogg") #if display private #end class __ASSET__flixel_sounds_flixel_ogg extends lime.utils.ByteArray {} +@:font("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/fonts/nokiafc22.ttf") #if display private #end class __ASSET__flixel_fonts_nokiafc22_ttf extends lime.text.Font {} +@:font("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/fonts/monsterrat.ttf") #if display private #end class __ASSET__flixel_fonts_monsterrat_ttf extends lime.text.Font {} +@:image("C:/HaxeToolkit/haxe/lib/flixel/4,1,1/assets/images/ui/button.png") #if display private #end class __ASSET__flixel_images_ui_button_png extends lime.graphics.Image {} + + + +#end +#end + +#if (openfl && !flash) +@:keep #if display private #end class __ASSET__OPENFL__assets_data_earlygameboy_ttf extends openfl.text.Font { public function new () { __fontPath = #if ios "assets/" + #end "assets/data/EarlyGameBoy.ttf"; name = "Early GameBoy Regular"; super (); }} +@:keep #if display private #end class __ASSET__OPENFL__flixel_fonts_nokiafc22_ttf extends openfl.text.Font { public function new () { var font = new __ASSET__flixel_fonts_nokiafc22_ttf (); src = font.src; name = font.name; super (); }} +@:keep #if display private #end class __ASSET__OPENFL__flixel_fonts_monsterrat_ttf extends openfl.text.Font { public function new () { var font = new __ASSET__flixel_fonts_monsterrat_ttf (); src = font.src; name = font.name; super (); }} + +#end + +#end + + +#end \ No newline at end of file diff --git a/export/windows/neko/haxe/NMEPreloader.hx b/export/windows/neko/haxe/NMEPreloader.hx new file mode 100644 index 0000000..4354320 --- /dev/null +++ b/export/windows/neko/haxe/NMEPreloader.hx @@ -0,0 +1,115 @@ +import openfl.display.Sprite; +import openfl.events.Event; + + +class NMEPreloader extends Sprite +{ + private var outline:Sprite; + private var progress:Sprite; + + + public function new() + { + super(); + + var backgroundColor = getBackgroundColor (); + var r = backgroundColor >> 16 & 0xFF; + var g = backgroundColor >> 8 & 0xFF; + var b = backgroundColor & 0xFF; + var perceivedLuminosity = (0.299 * r + 0.587 * g + 0.114 * b); + var color = 0x000000; + + if (perceivedLuminosity < 70) { + + color = 0xFFFFFF; + + } + + var x = 30; + var height = 9; + var y = getHeight () / 2 - height / 2; + var width = getWidth () - x * 2; + + var padding = 3; + + outline = new Sprite (); + outline.graphics.lineStyle (1, color, 0.15, true); + outline.graphics.drawRoundRect (0, 0, width, height, padding * 2, padding * 2); + outline.x = x; + outline.y = y; + addChild (outline); + + progress = new Sprite (); + progress.graphics.beginFill (color, 0.35); + progress.graphics.drawRect (0, 0, width - padding * 2, height - padding * 2); + progress.x = x + padding; + progress.y = y + padding; + progress.scaleX = 0; + addChild (progress); + } + + + public function getBackgroundColor():Int + { + return 0; + } + + + public function getHeight():Float + { + var height = 144; + + if (height > 0) { + + return height; + + } else { + + return flash.Lib.current.stage.stageHeight; + + } + } + + + public function getWidth():Float + { + var width = 160; + + if (width > 0) { + + return width; + + } else { + + return flash.Lib.current.stage.stageWidth; + + } + } + + + public function onInit() + { + + } + + + public function onLoaded() + { + dispatchEvent (new Event (Event.COMPLETE)); + } + + + public function onUpdate(bytesLoaded:Int, bytesTotal:Int) + { + var percentLoaded = bytesLoaded / bytesTotal; + + if (percentLoaded > 1) + { + percentLoaded = 1; + } + + progress.scaleX = percentLoaded; + } + + +} \ No newline at end of file diff --git a/export/windows/neko/haxe/debug.hxml b/export/windows/neko/haxe/debug.hxml new file mode 100644 index 0000000..82c18c9 --- /dev/null +++ b/export/windows/neko/haxe/debug.hxml @@ -0,0 +1,33 @@ +-main ApplicationMain +-cp C:/HaxeToolkit/haxe/lib/flixel/4,1,1 +-D flixel=4.1.1 +-cp C:/HaxeToolkit/haxe/lib/lime/2,9,1 +-D lime=2.9.1 +-cp C:/HaxeToolkit/haxe/lib/openfl/3,6,1 +-D openfl=3.6.1 +--macro keep('IntIterator') +-cp C:/HaxeToolkit/haxe/lib/hscript/2,0,7 +-D hscript=2.0.7 +-cp C:/HaxeToolkit/haxe/lib/flixel-addons/2,1,0 +-D flixel-addons=2.1.0 +-cp source +-cp C:\HaxeToolkit\haxe\lib\lime/2,9,1/legacy +-D HXCPP_QUIET +-D openfl-legacy +-D tools=2.9.1 +-D lime-legacy +-D NAPE_NO_INLINE +-D no-compilation +-D native +-D FLX_NO_TOUCH +-D openfl-native +-D lime-native +-D windows +-D desktop +--remap flash:openfl +--macro exclude('lime') +--macro flixel.system.macros.FlxDefines.run() +-cp export/windows/neko/haxe +-neko export/windows/neko/obj/ApplicationMain.n +--macro keep("Main") +-debug \ No newline at end of file diff --git a/export/windows/neko/haxe/final.hxml b/export/windows/neko/haxe/final.hxml new file mode 100644 index 0000000..1b6afdc --- /dev/null +++ b/export/windows/neko/haxe/final.hxml @@ -0,0 +1,33 @@ +-main ApplicationMain +-cp C:/HaxeToolkit/haxe/lib/flixel/4,1,1 +-D flixel=4.1.1 +-cp C:/HaxeToolkit/haxe/lib/lime/2,9,1 +-D lime=2.9.1 +-cp C:/HaxeToolkit/haxe/lib/openfl/3,6,1 +-D openfl=3.6.1 +--macro keep('IntIterator') +-cp C:/HaxeToolkit/haxe/lib/hscript/2,0,7 +-D hscript=2.0.7 +-cp C:/HaxeToolkit/haxe/lib/flixel-addons/2,1,0 +-D flixel-addons=2.1.0 +-cp source +-cp C:\HaxeToolkit\haxe\lib\lime/2,9,1/legacy +-D HXCPP_QUIET +-D openfl-legacy +-D tools=2.9.1 +-D lime-legacy +-D NAPE_NO_INLINE +-D no-compilation +-D native +-D FLX_NO_TOUCH +-D openfl-native +-D lime-native +-D windows +-D desktop +--remap flash:openfl +--macro exclude('lime') +--macro flixel.system.macros.FlxDefines.run() +-cp export/windows/neko/haxe +-neko export/windows/neko/obj/ApplicationMain.n +--macro keep("Main") +-D final \ No newline at end of file diff --git a/export/windows/neko/haxe/lime/AssetData.hx b/export/windows/neko/haxe/lime/AssetData.hx new file mode 100644 index 0000000..1903bfe --- /dev/null +++ b/export/windows/neko/haxe/lime/AssetData.hx @@ -0,0 +1,84 @@ +package lime; + + +import lime.utils.Assets; + + +class AssetData { + + private static var initialized:Bool = false; + + public static var library = new #if haxe3 Map (); + public static var path = new #if haxe3 Map (); + public static var type = new #if haxe3 Map (); + + public static function initialize():Void { + + if (!initialized) { + + path.set ("assets/data/EarlyGameBoy.ttf", "assets/data/EarlyGameBoy.ttf"); + type.set ("assets/data/EarlyGameBoy.ttf", Reflect.field (AssetType, "font".toUpperCase ())); + path.set ("assets/icon.png", "assets/icon.png"); + type.set ("assets/icon.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/background.png", "assets/images/background.png"); + type.set ("assets/images/background.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Cheer.png", "assets/images/Cheer.png"); + type.set ("assets/images/Cheer.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Config.png", "assets/images/Config.png"); + type.set ("assets/images/Config.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Egg.png", "assets/images/Egg.png"); + type.set ("assets/images/Egg.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Egg2.png", "assets/images/Egg2.png"); + type.set ("assets/images/Egg2.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Egg3.png", "assets/images/Egg3.png"); + type.set ("assets/images/Egg3.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Feed.png", "assets/images/Feed.png"); + type.set ("assets/images/Feed.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/HUD_Background.png", "assets/images/HUD_Background.png"); + type.set ("assets/images/HUD_Background.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Info.png", "assets/images/Info.png"); + type.set ("assets/images/Info.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Player.png", "assets/images/Player.png"); + type.set ("assets/images/Player.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Rest.png", "assets/images/Rest.png"); + type.set ("assets/images/Rest.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Rest_old.png", "assets/images/Rest_old.png"); + type.set ("assets/images/Rest_old.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Scold.png", "assets/images/Scold.png"); + type.set ("assets/images/Scold.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/tmp20.png", "assets/images/tmp20.png"); + type.set ("assets/images/tmp20.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/tmp32.png", "assets/images/tmp32.png"); + type.set ("assets/images/tmp32.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/tmpSelect.png", "assets/images/tmpSelect.png"); + type.set ("assets/images/tmpSelect.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Train.png", "assets/images/Train.png"); + type.set ("assets/images/Train.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/images/Wipe.png", "assets/images/Wipe.png"); + type.set ("assets/images/Wipe.png", Reflect.field (AssetType, "image".toUpperCase ())); + path.set ("assets/music/music-goes-here.txt", "assets/music/music-goes-here.txt"); + type.set ("assets/music/music-goes-here.txt", Reflect.field (AssetType, "text".toUpperCase ())); + path.set ("assets/sounds/Next.ogg", "assets/sounds/Next.ogg"); + type.set ("assets/sounds/Next.ogg", Reflect.field (AssetType, "sound".toUpperCase ())); + path.set ("assets/sounds/Select.ogg", "assets/sounds/Select.ogg"); + type.set ("assets/sounds/Select.ogg", Reflect.field (AssetType, "sound".toUpperCase ())); + path.set ("flixel/sounds/beep.ogg", "flixel/sounds/beep.ogg"); + type.set ("flixel/sounds/beep.ogg", Reflect.field (AssetType, "sound".toUpperCase ())); + path.set ("flixel/sounds/flixel.ogg", "flixel/sounds/flixel.ogg"); + type.set ("flixel/sounds/flixel.ogg", Reflect.field (AssetType, "sound".toUpperCase ())); + path.set ("flixel/fonts/nokiafc22.ttf", "flixel/fonts/nokiafc22.ttf"); + type.set ("flixel/fonts/nokiafc22.ttf", Reflect.field (AssetType, "font".toUpperCase ())); + path.set ("flixel/fonts/monsterrat.ttf", "flixel/fonts/monsterrat.ttf"); + type.set ("flixel/fonts/monsterrat.ttf", Reflect.field (AssetType, "font".toUpperCase ())); + path.set ("flixel/images/ui/button.png", "flixel/images/ui/button.png"); + type.set ("flixel/images/ui/button.png", Reflect.field (AssetType, "image".toUpperCase ())); + + + initialized = true; + + } //!initialized + + } //initialize + + +} //AssetData diff --git a/export/windows/neko/haxe/release.hxml b/export/windows/neko/haxe/release.hxml new file mode 100644 index 0000000..5c0a04a --- /dev/null +++ b/export/windows/neko/haxe/release.hxml @@ -0,0 +1,32 @@ +-main ApplicationMain +-cp C:/HaxeToolkit/haxe/lib/flixel/4,1,1 +-D flixel=4.1.1 +-cp C:/HaxeToolkit/haxe/lib/lime/2,9,1 +-D lime=2.9.1 +-cp C:/HaxeToolkit/haxe/lib/openfl/3,6,1 +-D openfl=3.6.1 +--macro keep('IntIterator') +-cp C:/HaxeToolkit/haxe/lib/hscript/2,0,7 +-D hscript=2.0.7 +-cp C:/HaxeToolkit/haxe/lib/flixel-addons/2,1,0 +-D flixel-addons=2.1.0 +-cp source +-cp C:\HaxeToolkit\haxe\lib\lime/2,9,1/legacy +-D HXCPP_QUIET +-D openfl-legacy +-D tools=2.9.1 +-D lime-legacy +-D NAPE_NO_INLINE +-D no-compilation +-D native +-D FLX_NO_TOUCH +-D openfl-native +-D lime-native +-D windows +-D desktop +--remap flash:openfl +--macro exclude('lime') +--macro flixel.system.macros.FlxDefines.run() +-cp export/windows/neko/haxe +-neko export/windows/neko/obj/ApplicationMain.n +--macro keep("Main") \ No newline at end of file diff --git a/export/windows/neko/obj/ApplicationMain.n b/export/windows/neko/obj/ApplicationMain.n new file mode 100644 index 0000000..f20e24b Binary files /dev/null and b/export/windows/neko/obj/ApplicationMain.n differ diff --git a/source/AssetPaths.hx b/source/AssetPaths.hx new file mode 100644 index 0000000..8290870 --- /dev/null +++ b/source/AssetPaths.hx @@ -0,0 +1,4 @@ +package; + +@:build(flixel.system.FlxAssets.buildFileReferences("assets", true)) +class AssetPaths {} \ No newline at end of file diff --git a/source/Gel.hx b/source/Gel.hx new file mode 100644 index 0000000..80421e5 --- /dev/null +++ b/source/Gel.hx @@ -0,0 +1,99 @@ +package; + +import flixel.FlxG; +import flixel.FlxSprite; + +class Gel extends FlxSprite +{ + // Modifiers Range + private var MIN_LEVEL(default, never):Int = 0; + private var MAX_LEVEL(default, never):Int = 100; + + // Usless Stats that have no pupose yet + public var Int:Int = 0; + public var Age:Int = 0; + + // Mood Modifiers + public var Happiness:Int = 50; + public var Discipline:Int = 50; + public var Fullness = 50; + + //private var _inEgg:Bool = true; + private var _isHungry:Bool = false; + private var _hasEaten:Bool = false; + private var _madeWaste:Bool = false; + + // Mood + private var _currentMood:Mood = NORMAL; + + + + public function new(?X:Float=0, ?Y:Float=0) + { + super(X, Y); + + loadGraphic(AssetPaths.Player__png, true, 64, 64); + animation.add("blink", [1, 2, 3, 4, 5, 6, 5, 4, 3, 2], 5, true); + + + // DEBUG + FlxG.watch.add(this, "Happiness"); + FlxG.watch.add(this, "Fullness"); + } + + override function update(elsapsed:Float):Void + { + if (animation.curAnim == null) + animation.play("blink"); + + super.update(elsapsed); + } + + private function checkMood():Void + { + + } + + /* + * + */ + public function EatFood():Void + { + // Stat changes + Fullness += 25; + Happiness += 10; + + checkRange(); + } + + private function checkRange():Void + { + if (Fullness > MAX_LEVEL) + Fullness = MAX_LEVEL; + else if (Fullness < MIN_LEVEL) + Fullness = MIN_LEVEL; + + if (Happiness > MAX_LEVEL) + Happiness = MAX_LEVEL; + else if (Happiness < MIN_LEVEL) + Happiness = MIN_LEVEL; + + if (Discipline > MAX_LEVEL) + Discipline = MAX_LEVEL; + else if (Discipline < MIN_LEVEL) + Discipline = MIN_LEVEL; + } +} + +enum Mood +{ + NORMAL; + HAPPY; + ANGRY; + HUNGRY; + TIRED; + WASTE; + + ENCOURAGED; + SAD; +} \ No newline at end of file diff --git a/source/HUD.hx b/source/HUD.hx new file mode 100644 index 0000000..b09a35b --- /dev/null +++ b/source/HUD.hx @@ -0,0 +1,235 @@ +package; + +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.group.FlxGroup; +import flixel.system.FlxSound; +import flixel.text.FlxText; +import flixel.util.FlxColor; + +class HUD extends FlxTypedGroup +{ + // Top + private var _sprTop:FlxSprite; + private var _txtInfo:FlxText; + private var _sprInfo:FlxSprite; + private var _txtFeed:FlxText; + private var _sprFeed:FlxSprite; + private var _txtTrain:FlxText; + private var _sprTrain:FlxSprite; + private var _txtRest:FlxText; + private var _sprRest:FlxSprite; + + // Bottom + private var _sprBottom:FlxSprite; + private var _txtCheer:FlxText; + private var _sprCheer:FlxSprite; + private var _txtScold:FlxText; + private var _sprScold:FlxSprite; + private var _txtWipe:FlxText; + private var _sprWipe:FlxSprite; + private var _txtConfig:FlxText; + private var _sprConfig:FlxSprite; + + // Sounds + private var _sndSelect:FlxSound; + private var _sndNext:FlxSound; + + // Misc + private var _menuOption:Int; + private var _sprSelect:FlxSprite; + + private var _gel:Gel; + + public function new(g:Gel) + { + super(); + + // Top + _sprTop = new FlxSprite(0, 0, AssetPaths.HUD_Background__png); + add(_sprTop); + + // Info + _txtInfo = new FlxText(1, (_sprTop.height - 13), 0, "Info", 8); + _txtInfo.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); + add(_txtInfo); + _sprInfo = new FlxSprite((_txtInfo.x + 3), (_txtInfo.y - 17), AssetPaths.Info__png); + add(_sprInfo); + + // Feed + _txtFeed = new FlxText((_txtInfo.x + _txtInfo.width + 4), (_sprTop.height - 13), 0, "Feed", 8); + _txtFeed.setFormat(AssetPaths.EarlyGameBoy__ttf, 8 , FlxColor.fromRGB(8, 24, 32, 0), CENTER); + add(_txtFeed); + _sprFeed = new FlxSprite((_txtFeed.x + 2), (_txtFeed.y - 17), AssetPaths.Feed__png); + add(_sprFeed); + + // Train + _txtTrain = new FlxText((_txtFeed.x + _txtFeed.width - 1), (_sprTop.height - 13), 0, "Train", 8); + _txtTrain.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); + add(_txtTrain); + _sprTrain = new FlxSprite((_txtTrain.x + 6), (_txtTrain.y - 17), AssetPaths.Train__png); + add(_sprTrain); + + // Rest + _txtRest = new FlxText((_txtTrain.x + _txtTrain.width), (_sprTop.height - 13), 0, "Rest", 8); + _txtRest.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); + add(_txtRest); + _sprRest = new FlxSprite((_txtRest.x + 2), (_txtRest.y - 17), AssetPaths.Rest__png); + add(_sprRest); + + + // Bottom + _sprBottom = new FlxSprite(0, (FlxG.height - _sprTop.height), AssetPaths.HUD_Background__png); + add(_sprBottom); + + // Cheer + _txtCheer = new FlxText(-2, (FlxG.height - 13), 0, "Cheer", 8); + _txtCheer.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); + add(_txtCheer); + _sprCheer = new FlxSprite((_txtCheer.x + 6), (_txtCheer.y - 17), AssetPaths.Cheer__png); + add (_sprCheer); + + // Scold + _txtScold = new FlxText((_txtCheer.x + _txtCheer.width - 5), (FlxG.height - 13), 0, "Scold", 8); + _txtScold.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); + add(_txtScold); + _sprScold = new FlxSprite((_txtScold.x + 6), (_txtScold.y - 17), AssetPaths.Scold__png); + add(_sprScold); + + // Wipe + _txtWipe = new FlxText((_txtScold.x + _txtScold.width - 1), (FlxG.height - 13), 0, "Wipe", 8); + _txtWipe.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); + add(_txtWipe); + _sprWipe = new FlxSprite((_txtWipe.x + 2), (_txtWipe.y - 17), AssetPaths.Wipe__png); + add(_sprWipe); + + // Config + _txtConfig = new FlxText((_txtWipe.x + _txtWipe.width + 3), (FlxG.height - 13), 0, "Conf", 8); + _txtConfig.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); + add(_txtConfig); + _sprConfig = new FlxSprite((_txtConfig.x + 2), (_txtConfig.y - 17), AssetPaths.Config__png); + add(_sprConfig); + + // Sound + _sndSelect = FlxG.sound.load(AssetPaths.Select__ogg); + _sndNext = FlxG.sound.load(AssetPaths.Next__ogg); + + // Misc + _menuOption = 0; + _gel = g; + + _sprSelect = new FlxSprite(0, 0, AssetPaths.tmpSelect__png); + add(_sprSelect); + + // DEBUG + FlxG.watch.add(this, "_menuOption", "Menu Index"); + FlxG.watch.add(_sprSelect, "x", "Selection X"); + FlxG.watch.add(_sprSelect, "y", "Selection Y"); + } + + override public function update(elapsed:Float):Void + { + super.update(elapsed); + + if (FlxG.keys.justPressed.RIGHT) + nextOption(true); + else if (FlxG.keys.justPressed.LEFT) + nextOption(false); + else if (FlxG.keys.justPressed.X) + makeOption(_menuOption); + + } + + + private function nextOption(increment:Bool):Void + { + if (increment) + { + if (_menuOption >= 7) + _menuOption = 0; + else + _menuOption++; + + if (_menuOption >= 4) + { + _sprSelect.x = (_menuOption - 4) * 40; + _sprSelect.y = _sprBottom.y; + } + else + { + _sprSelect.x = _menuOption * 40; + _sprSelect.y = 0; + } + + } + else + { + if (_menuOption <= 0) + _menuOption = 7; + else + _menuOption--; + + if (_menuOption >= 4) + { + _sprSelect.x = (_menuOption - 4) * 40; + _sprSelect.y = _sprBottom.y; + } + else + { + _sprSelect.x = _menuOption * 40; + _sprSelect.y = 0; + } + + } + _sndNext.play(true); + } + + private function makeOption(option:Int):Void + { + switch(option) + { + case 0: + // + + // FEED + case 1: + feedGel(); + + case 2: + // + + case 3: + // + + case 4: + // + + case 5: + // + + case 6: + // + + case 7: + // + } + _sndSelect.play(true); + } + + private function feedGel():Void + { + _gel.EatFood(); + } + +} +enum MenuOption +{ + INFO; + FEED; + TRAIN; + REST; + CHEER; + SCOLD; + WIPE; + CONFIG; +} \ No newline at end of file diff --git a/source/Main.hx b/source/Main.hx new file mode 100644 index 0000000..c7c3e8d --- /dev/null +++ b/source/Main.hx @@ -0,0 +1,15 @@ +package; + +import flixel.FlxGame; +import openfl.Lib; +import openfl.display.Sprite; + +class Main extends Sprite +{ + + public function new() + { + super(); + addChild(new FlxGame(0, 0, MenuState)); + } +} diff --git a/source/MenuState.hx b/source/MenuState.hx new file mode 100644 index 0000000..388748a --- /dev/null +++ b/source/MenuState.hx @@ -0,0 +1,66 @@ +package; + +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.FlxState; +import flixel.input.gamepad.FlxGamepad; +import flixel.system.FlxSound; +import flixel.text.FlxText; +import flixel.util.FlxColor; + +class MenuState extends FlxState +{ + private var _sprBackground:FlxSprite; + private var _sprEgg:FlxSprite; + + private var _txtTitle:FlxText; + private var _txtMessage:FlxText; + + private var _sndSelect:FlxSound; + + override public function create():Void + { + set_bgColor(FlxColor.fromRGB(136, 192, 112, 0)); + FlxG.mouse.visible = false; + + _sprBackground = new FlxSprite(0, 0, AssetPaths.background__png); + add(_sprBackground); + + _txtTitle = new FlxText(20, 0, 0, "Pet.GB", 8); + _txtTitle.setFormat(AssetPaths.EarlyGameBoy__ttf, 16, FlxColor.fromRGB(8, 24, 32, 0), CENTER); + _txtTitle.screenCenter(X); + add(_txtTitle); + + _sprEgg = new FlxSprite(0, 0, AssetPaths.Egg__png); + _sprEgg.x = (FlxG.width/2) - (_sprEgg.width/2); + _sprEgg.y = (FlxG.height/2) - (_sprEgg.height/2); + add(_sprEgg); + + + _txtMessage = new FlxText(0, FlxG.height - 20, 0, "Press Start", 8); + _txtMessage.setFormat(AssetPaths.EarlyGameBoy__ttf, 8, FlxColor.fromRGB(8, 24, 32, 0), CENTER); + _txtMessage.screenCenter(X); + add(_txtMessage); + + _sndSelect = FlxG.sound.load(AssetPaths.Select__ogg); + + super.create(); + } + + override public function update(elapsed:Float):Void + { + if(FlxG.keys.pressed.ENTER) + pressStart(); + + super.update(elapsed); + } + + private function pressStart():Void + { + _sndSelect.play(true); + FlxG.camera.fade(FlxColor.fromRGB(136, 192, 112, 0), 0.5, true, function() + { + FlxG.switchState(new PlayState()); + }); + } +} diff --git a/source/PlayState.hx b/source/PlayState.hx new file mode 100644 index 0000000..4f8c910 --- /dev/null +++ b/source/PlayState.hx @@ -0,0 +1,38 @@ +package; + +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.FlxState; +import flixel.text.FlxText; +import flixel.ui.FlxButton; +import flixel.math.FlxMath; + +class PlayState extends FlxState +{ + private var _sprBackground:FlxSprite; + + private var _gelPet:Gel; + + private var _hud:HUD; + + override public function create():Void + { + _sprBackground = new FlxSprite(0, 0, AssetPaths.background__png); + add(_sprBackground); + + _gelPet = new Gel(); + _gelPet.x = ((FlxG.width/2) - (_gelPet.width/2)); + _gelPet.y = ((FlxG.height/2) - (_gelPet.height/2)); + add(_gelPet); + + _hud = new HUD(_gelPet); + add(_hud); + + super.create(); + } + + override public function update(elapsed:Float):Void + { + super.update(elapsed); + } +}