├── tools └── map-converter │ ├── .gitignore │ ├── README.md │ ├── dev-tiles.tsx │ └── package.json ├── engine ├── include │ └── hikari │ │ ├── core │ │ ├── gui │ │ │ └── HikariImageLoader.cpp │ │ ├── math │ │ │ ├── FixedPoint.hpp │ │ │ └── Constants.hpp │ │ ├── Hikari.hpp │ │ ├── Platform.hpp │ │ ├── util │ │ │ ├── Service.hpp │ │ │ ├── JsonUtils.hpp │ │ │ ├── Cloneable.hpp │ │ │ ├── exception │ │ │ │ ├── HikariException.hpp │ │ │ │ └── ServiceNotRegisteredException.hpp │ │ │ ├── TilesetCache.hpp │ │ │ ├── RedirectStream.hpp │ │ │ ├── AnimationSetCache.hpp │ │ │ ├── HashedString.hpp │ │ │ ├── PhysFSUtils.hpp │ │ │ ├── ImageCache.hpp │ │ │ ├── Timer.hpp │ │ │ └── ResourceCache.hpp │ │ └── game │ │ │ ├── map │ │ │ ├── camera │ │ │ │ ├── CameraStrategy.hpp │ │ │ │ └── FollowingCameraStrategy.hpp │ │ │ ├── Force.hpp │ │ │ └── RoomTransition.hpp │ │ │ ├── Direction.hpp │ │ │ ├── Updatable.hpp │ │ │ ├── GameControllerException.hpp │ │ │ ├── AnimationPlaybackException.hpp │ │ │ ├── CollisionResolver.hpp │ │ │ ├── FadeStateTransition.hpp │ │ │ ├── SpriteAnimator.hpp │ │ │ ├── TileAnimator.hpp │ │ │ ├── CollisionInfo.hpp │ │ │ ├── AnimationFrame.hpp │ │ │ ├── GameState.hpp │ │ │ └── Renderable.hpp │ │ └── client │ │ ├── Main.hpp │ │ ├── game │ │ ├── DamageKey.hpp │ │ ├── Direction.hpp │ │ ├── objects │ │ │ ├── HeroIdleMobilityState.hpp │ │ │ ├── HeroAirbornMobilityState.hpp │ │ │ ├── HitBox.hpp │ │ │ ├── BlockTiming.hpp │ │ │ ├── Motion.hpp │ │ │ ├── HeroSlidingMobilityState.hpp │ │ │ ├── HeroDamagedMobilityState.hpp │ │ │ ├── HeroWalkingMobilityState.hpp │ │ │ ├── HeroClimbingMobilityState.hpp │ │ │ ├── effects │ │ │ │ ├── NothingEffect.hpp │ │ │ │ └── ScriptedEffect.hpp │ │ │ ├── HeroTeleportingMobilityState.hpp │ │ │ ├── EntityDeathType.hpp │ │ │ ├── Faction.hpp │ │ │ ├── controllers │ │ │ │ └── HeroActionController.hpp │ │ │ ├── GameObject.hpp │ │ │ ├── ItemSpawner.hpp │ │ │ ├── RockmanHero.hpp │ │ │ ├── ParticleFactory.hpp │ │ │ └── CollectableItem.hpp │ │ ├── WaitTask.hpp │ │ ├── Effect.hpp │ │ ├── PaletteHelpers.hpp │ │ ├── events │ │ │ ├── BaseEventData.hpp │ │ │ ├── TransitionCollisionEventData.hpp │ │ │ ├── EventData.hpp │ │ │ ├── DoorEventData.hpp │ │ │ ├── EntityDamageEventData.hpp │ │ │ ├── GameQuitEventData.hpp │ │ │ ├── EntityStateChangeEventData.hpp │ │ │ ├── ObjectRemovedEventData.hpp │ │ │ ├── EntityDeathEventData.hpp │ │ │ └── AudioEventData.hpp │ │ ├── Shot.hpp │ │ ├── FunctionTask.hpp │ │ ├── GOCreationParameters.hpp │ │ ├── WeaponAction.hpp │ │ ├── SpawnProjectileWeaponAction.hpp │ │ ├── EndingState.hpp │ │ ├── BaseTask.hpp │ │ ├── InputService.hpp │ │ ├── RefillHealthTask.hpp │ │ ├── FadeColorTask.hpp │ │ ├── GuiTestState.hpp │ │ ├── EventBusService.hpp │ │ └── IntroState.hpp │ │ ├── gui │ │ ├── Orientation.hpp │ │ ├── BossMenu.hpp │ │ ├── IconAnimator.hpp │ │ ├── Panel.hpp │ │ ├── HikariImageLoader.hpp │ │ ├── MenuItem.hpp │ │ └── Widget.hpp │ │ ├── scripting │ │ └── SquirrelUtils.hpp │ │ ├── CommandProcessor.hpp │ │ └── Services.hpp └── src │ └── hikari │ ├── client │ ├── game │ │ ├── Effect.cpp │ │ ├── Task.cpp │ │ ├── events │ │ │ ├── EventData.cpp │ │ │ ├── EventBus.cpp │ │ │ ├── BaseEventData.cpp │ │ │ ├── EventListenerDelegate.cpp │ │ │ ├── TransitionCollisionEventData.cpp │ │ │ ├── DoorEventData.cpp │ │ │ ├── GameQuitEventData.cpp │ │ │ ├── ObjectRemovedEventData.cpp │ │ │ ├── EntityDamageEventData.cpp │ │ │ ├── AudioEventData.cpp │ │ │ └── EntityDeathEventData.cpp │ │ ├── objects │ │ │ ├── HitBox.cpp │ │ │ ├── BlockTiming.cpp │ │ │ ├── Motion.cpp │ │ │ ├── effects │ │ │ │ └── NothingEffect.cpp │ │ │ └── GameObject.cpp │ │ ├── WaitTask.cpp │ │ ├── WeaponAction.cpp │ │ ├── FunctionTask.cpp │ │ ├── BaseTask.cpp │ │ ├── DamageTable.cpp │ │ ├── FadeColorTask.cpp │ │ └── Shot.cpp │ ├── Main.cpp │ ├── gui │ │ ├── Widget.cpp │ │ ├── InputHelper.cpp │ │ └── HikariImageLoader.cpp │ └── scripting │ │ └── GamePlayStateScriptProxy.cpp │ └── core │ ├── Hikari.cpp │ ├── util │ ├── exception │ │ ├── HikariException.cpp │ │ └── ServiceNotRegisteredException.cpp │ ├── RedirectStream.cpp │ ├── AnimationSetCache.cpp │ ├── JsonUtil.cpp │ └── HashedString.cpp │ └── game │ ├── GameControllerException.cpp │ ├── AnimationPlaybackException.cpp │ ├── Faction.cpp │ ├── map │ └── Force.cpp │ ├── Direction.cpp │ ├── SliceStateTransition.hpp │ ├── AnimationFrame.cpp │ ├── CollisionInfo.cpp │ └── Animation.cpp ├── content ├── assets │ ├── scripts │ │ ├── behaviors │ │ │ ├── TellyBehaviorOverrides.nut │ │ │ ├── PeterchyEnemyBehavior.nut │ │ │ ├── AppearingBlockBehavior.nut │ │ │ └── DoodadBehavior.nut │ │ ├── TestRequire.nut │ │ ├── effects │ │ │ ├── ExtraLifeEffect.nut │ │ │ ├── AddETankEffect.nut │ │ │ ├── ModifyHealthEffect.nut │ │ │ └── ModifyWeaponEnergyEffect.nut │ │ ├── EffectBase.nut │ │ └── Bootstrap.nut │ ├── images │ │ ├── gui-font.png │ │ ├── sp-doors.png │ │ ├── tile-dev.png │ │ ├── menu-font.png │ │ ├── rockman-32.png │ │ ├── sp-doodads.png │ │ ├── sp-enemies.png │ │ ├── tile-bubble.png │ │ ├── tile-skull.png │ │ ├── tile-spark.png │ │ ├── tile-test1.png │ │ ├── tile-wily1.png │ │ ├── bg-weapon-get.png │ │ ├── meter-overlay.png │ │ ├── rockman-32_2.png │ │ ├── sp-gui-atlas.png │ │ ├── sp-particles.png │ │ ├── tile-pearlman.png │ │ ├── bg-stage-select.png │ │ ├── bg-weapon-menu.png │ │ ├── eye-stage-select.png │ │ ├── fg-stage-select.png │ │ ├── gui-title-logo.png │ │ ├── rockman-32.pal.png │ │ ├── sp-collectables.png │ │ ├── sp-projectiles.png │ │ └── cursor-stage-select.png │ ├── sound │ │ ├── dr_cossack_2.nsf │ │ ├── mega-man-2-nes-[NSF-ID2018].nsf │ │ ├── mega-man-3-nes-[NSF-ID2016].nsf │ │ ├── mega-man-4-nes-[NSF-ID1520].nsf │ │ └── mega-man-nes-[NSF-ID1961].nsf │ ├── tilesets │ │ ├── tiles-dev.json │ │ └── tiles-skull.json │ ├── fonts.json │ ├── animations │ │ ├── stage-select.json │ │ ├── cursor.json │ │ ├── heroes-dev.json │ │ └── heroes.json │ ├── shaders │ │ ├── palette.frag │ │ └── fade.frag │ └── tilesets.json ├── test.nsf ├── openal32.dll ├── damage.json ├── conf.json └── tileset-skull.json ├── extlibs ├── jsoncpp │ ├── AUTHORS │ ├── LICENSE │ ├── README.md │ └── include │ │ └── json │ │ ├── json.h │ │ ├── autolink.h │ │ └── forwards.h ├── guichan │ ├── README │ ├── AUTHORS │ ├── COPYING │ ├── src │ │ ├── gui.cpp │ │ ├── key.cpp │ │ ├── color.cpp │ │ ├── event.cpp │ │ ├── font.cpp │ │ ├── image.cpp │ │ ├── text.cpp │ │ ├── graphics.cpp │ │ ├── guichan.cpp │ │ ├── keyevent.cpp │ │ ├── keyinput.cpp │ │ ├── widget.cpp │ │ ├── exception.cpp │ │ ├── imagefont.cpp │ │ ├── inputevent.cpp │ │ ├── mouseevent.cpp │ │ ├── mouseinput.cpp │ │ ├── rectangle.cpp │ │ ├── actionevent.cpp │ │ ├── cliprectangle.cpp │ │ ├── defaultfont.cpp │ │ ├── focushandler.cpp │ │ ├── genericinput.cpp │ │ ├── widgets │ │ │ ├── icon.cpp │ │ │ ├── label.cpp │ │ │ ├── tab.cpp │ │ │ ├── button.cpp │ │ │ ├── listbox.cpp │ │ │ ├── slider.cpp │ │ │ ├── textbox.cpp │ │ │ ├── window.cpp │ │ │ ├── checkbox.cpp │ │ │ ├── container.cpp │ │ │ ├── dropdown.cpp │ │ │ ├── scrollarea.cpp │ │ │ ├── tabbedarea.cpp │ │ │ ├── textfield.cpp │ │ │ ├── imagebutton.cpp │ │ │ └── radiobutton.cpp │ │ ├── containerevent.cpp │ │ └── selectionevent.cpp │ └── include │ │ ├── guichan.hpp │ │ └── guichan │ │ ├── gui.hpp │ │ ├── key.hpp │ │ ├── color.hpp │ │ ├── event.hpp │ │ ├── font.hpp │ │ ├── image.hpp │ │ ├── input.hpp │ │ ├── text.hpp │ │ ├── widget.hpp │ │ ├── graphics.hpp │ │ ├── keyevent.hpp │ │ ├── keyinput.hpp │ │ ├── platform.hpp │ │ ├── actionevent.hpp │ │ ├── defaultfont.hpp │ │ ├── exception.hpp │ │ ├── imagefont.hpp │ │ ├── imageloader.hpp │ │ ├── inputevent.hpp │ │ ├── keylistener.hpp │ │ ├── listmodel.hpp │ │ ├── mouseevent.hpp │ │ ├── mouseinput.hpp │ │ ├── rectangle.hpp │ │ ├── widgets │ │ ├── tab.hpp │ │ ├── icon.hpp │ │ ├── label.hpp │ │ ├── button.hpp │ │ ├── checkbox.hpp │ │ ├── dropdown.hpp │ │ ├── listbox.hpp │ │ ├── slider.hpp │ │ ├── textbox.hpp │ │ ├── window.hpp │ │ ├── container.hpp │ │ ├── scrollarea.hpp │ │ ├── tabbedarea.hpp │ │ ├── textfield.hpp │ │ ├── imagebutton.hpp │ │ └── radiobutton.hpp │ │ ├── cliprectangle.hpp │ │ ├── deathlistener.hpp │ │ ├── focushandler.hpp │ │ ├── focuslistener.hpp │ │ ├── genericinput.hpp │ │ ├── mouselistener.hpp │ │ ├── actionlistener.hpp │ │ ├── containerevent.hpp │ │ ├── selectionevent.hpp │ │ ├── widgetlistener.hpp │ │ ├── containerlistener.hpp │ │ └── selectionlistener.hpp ├── physfs-stream │ ├── README.md │ └── physfs │ │ ├── ifile_stream.cpp │ │ ├── ifile_stream.hpp │ │ ├── ofile_stream.hpp │ │ ├── ofile_stream.cpp │ │ └── physfs_file_system.hpp ├── guichan-sfml │ ├── src │ │ └── guichan │ │ │ ├── sfml.cpp │ │ │ └── sfml │ │ │ └── sfmlimageloader.cpp │ ├── .gitignore │ └── include │ │ └── guichan │ │ ├── sfml.hpp │ │ └── sfml │ │ └── sfmlimageloader.hpp ├── guichan-hakase │ └── .gitignore ├── squirrel │ ├── include │ │ ├── sqstdmath.h │ │ ├── sqstdsystem.h │ │ ├── sqstdaux.h │ │ ├── sqstdblob.h │ │ └── sqstdstring.h │ ├── squirrel │ │ ├── sqmem.cpp │ │ ├── sqpcheader.h │ │ ├── sqstring.h │ │ └── squserdata.h │ ├── sqstdlib │ │ └── sqstdstream.h │ ├── README │ └── COPYRIGHT ├── gme-nes │ ├── README.md │ ├── gme_types.h │ └── blargg_config.h ├── sqrat │ └── LICENSE └── knhit │ └── LICENSE ├── tests ├── src │ └── test │ │ └── Main.cpp └── CMakeLists.txt ├── MISC.md ├── ISSUES.md └── .gitignore /tools/map-converter/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /engine/include/hikari/core/gui/HikariImageLoader.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content/assets/scripts/behaviors/TellyBehaviorOverrides.nut: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content/assets/scripts/TestRequire.nut: -------------------------------------------------------------------------------- 1 | ::print("require() worked!"); -------------------------------------------------------------------------------- /extlibs/jsoncpp/AUTHORS: -------------------------------------------------------------------------------- 1 | Baptiste Lepilleur 2 | -------------------------------------------------------------------------------- /tests/src/test/Main.cpp: -------------------------------------------------------------------------------- 1 | #define CATCH_CONFIG_MAIN 2 | #include "catch.hpp" 3 | -------------------------------------------------------------------------------- /content/test.nsf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/test.nsf -------------------------------------------------------------------------------- /extlibs/jsoncpp/LICENSE: -------------------------------------------------------------------------------- 1 | The json-cpp library and this documentation are in Public Domain. 2 | -------------------------------------------------------------------------------- /content/openal32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/openal32.dll -------------------------------------------------------------------------------- /extlibs/guichan/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/README -------------------------------------------------------------------------------- /extlibs/guichan/AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/AUTHORS -------------------------------------------------------------------------------- /extlibs/guichan/COPYING: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/COPYING -------------------------------------------------------------------------------- /extlibs/guichan/src/gui.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/gui.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/key.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/key.cpp -------------------------------------------------------------------------------- /extlibs/physfs-stream/README.md: -------------------------------------------------------------------------------- 1 | physfs-stream 2 | ============= 3 | 4 | C++ stream wrappers for PhysicsFS -------------------------------------------------------------------------------- /extlibs/guichan/src/color.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/color.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/event.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/event.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/font.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/font.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/image.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/image.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/text.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/text.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/graphics.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/graphics.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/guichan.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/guichan.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/keyevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/keyevent.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/keyinput.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/keyinput.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widget.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widget.cpp -------------------------------------------------------------------------------- /content/assets/images/gui-font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/gui-font.png -------------------------------------------------------------------------------- /content/assets/images/sp-doors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/sp-doors.png -------------------------------------------------------------------------------- /content/assets/images/tile-dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/tile-dev.png -------------------------------------------------------------------------------- /extlibs/guichan/src/exception.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/exception.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/imagefont.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/imagefont.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/inputevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/inputevent.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/mouseevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/mouseevent.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/mouseinput.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/mouseinput.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/rectangle.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/rectangle.cpp -------------------------------------------------------------------------------- /content/assets/images/menu-font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/menu-font.png -------------------------------------------------------------------------------- /content/assets/images/rockman-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/rockman-32.png -------------------------------------------------------------------------------- /content/assets/images/sp-doodads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/sp-doodads.png -------------------------------------------------------------------------------- /content/assets/images/sp-enemies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/sp-enemies.png -------------------------------------------------------------------------------- /content/assets/images/tile-bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/tile-bubble.png -------------------------------------------------------------------------------- /content/assets/images/tile-skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/tile-skull.png -------------------------------------------------------------------------------- /content/assets/images/tile-spark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/tile-spark.png -------------------------------------------------------------------------------- /content/assets/images/tile-test1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/tile-test1.png -------------------------------------------------------------------------------- /content/assets/images/tile-wily1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/tile-wily1.png -------------------------------------------------------------------------------- /content/assets/sound/dr_cossack_2.nsf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/sound/dr_cossack_2.nsf -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan.hpp -------------------------------------------------------------------------------- /extlibs/guichan/src/actionevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/actionevent.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/cliprectangle.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/cliprectangle.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/defaultfont.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/defaultfont.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/focushandler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/focushandler.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/genericinput.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/genericinput.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/icon.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/icon.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/label.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/label.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/tab.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/tab.cpp -------------------------------------------------------------------------------- /content/assets/images/bg-weapon-get.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/bg-weapon-get.png -------------------------------------------------------------------------------- /content/assets/images/meter-overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/meter-overlay.png -------------------------------------------------------------------------------- /content/assets/images/rockman-32_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/rockman-32_2.png -------------------------------------------------------------------------------- /content/assets/images/sp-gui-atlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/sp-gui-atlas.png -------------------------------------------------------------------------------- /content/assets/images/sp-particles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/sp-particles.png -------------------------------------------------------------------------------- /content/assets/images/tile-pearlman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/tile-pearlman.png -------------------------------------------------------------------------------- /extlibs/guichan-sfml/src/guichan/sfml.cpp: -------------------------------------------------------------------------------- 1 | #include "guichan/sfml.hpp" 2 | 3 | extern "C" 4 | { 5 | void gcnSFML() { } 6 | } 7 | -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/gui.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/gui.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/key.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/key.hpp -------------------------------------------------------------------------------- /extlibs/guichan/src/containerevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/containerevent.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/selectionevent.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/selectionevent.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/button.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/button.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/listbox.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/listbox.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/slider.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/slider.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/textbox.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/textbox.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/window.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/window.cpp -------------------------------------------------------------------------------- /content/assets/images/bg-stage-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/bg-stage-select.png -------------------------------------------------------------------------------- /content/assets/images/bg-weapon-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/bg-weapon-menu.png -------------------------------------------------------------------------------- /content/assets/images/eye-stage-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/eye-stage-select.png -------------------------------------------------------------------------------- /content/assets/images/fg-stage-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/fg-stage-select.png -------------------------------------------------------------------------------- /content/assets/images/gui-title-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/gui-title-logo.png -------------------------------------------------------------------------------- /content/assets/images/rockman-32.pal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/rockman-32.pal.png -------------------------------------------------------------------------------- /content/assets/images/sp-collectables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/sp-collectables.png -------------------------------------------------------------------------------- /content/assets/images/sp-projectiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/sp-projectiles.png -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/color.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/color.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/event.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/event.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/font.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/font.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/image.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/image.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/input.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/input.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/text.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/text.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widget.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widget.hpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/checkbox.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/checkbox.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/container.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/container.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/dropdown.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/dropdown.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/scrollarea.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/scrollarea.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/tabbedarea.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/tabbedarea.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/textfield.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/textfield.cpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/graphics.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/graphics.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/keyevent.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/keyevent.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/keyinput.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/keyinput.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/platform.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/platform.hpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/imagebutton.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/imagebutton.cpp -------------------------------------------------------------------------------- /extlibs/guichan/src/widgets/radiobutton.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/src/widgets/radiobutton.cpp -------------------------------------------------------------------------------- /content/assets/images/cursor-stage-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/images/cursor-stage-select.png -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/actionevent.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/actionevent.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/defaultfont.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/defaultfont.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/exception.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/exception.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/imagefont.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/imagefont.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/imageloader.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/imageloader.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/inputevent.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/inputevent.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/keylistener.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/keylistener.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/listmodel.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/listmodel.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/mouseevent.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/mouseevent.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/mouseinput.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/mouseinput.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/rectangle.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/rectangle.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/tab.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/tab.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/cliprectangle.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/cliprectangle.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/deathlistener.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/deathlistener.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/focushandler.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/focushandler.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/focuslistener.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/focuslistener.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/genericinput.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/genericinput.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/mouselistener.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/mouselistener.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/icon.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/icon.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/label.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/label.hpp -------------------------------------------------------------------------------- /content/assets/sound/mega-man-2-nes-[NSF-ID2018].nsf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/sound/mega-man-2-nes-[NSF-ID2018].nsf -------------------------------------------------------------------------------- /content/assets/sound/mega-man-3-nes-[NSF-ID2016].nsf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/sound/mega-man-3-nes-[NSF-ID2016].nsf -------------------------------------------------------------------------------- /content/assets/sound/mega-man-4-nes-[NSF-ID1520].nsf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/sound/mega-man-4-nes-[NSF-ID1520].nsf -------------------------------------------------------------------------------- /content/assets/sound/mega-man-nes-[NSF-ID1961].nsf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/content/assets/sound/mega-man-nes-[NSF-ID1961].nsf -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/actionlistener.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/actionlistener.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/containerevent.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/containerevent.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/selectionevent.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/selectionevent.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgetlistener.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgetlistener.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/button.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/button.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/checkbox.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/checkbox.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/dropdown.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/dropdown.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/listbox.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/listbox.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/slider.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/slider.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/textbox.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/textbox.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/window.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/window.hpp -------------------------------------------------------------------------------- /tools/map-converter/README.md: -------------------------------------------------------------------------------- 1 | # TMX -> JSON Converter 2 | 3 | This is a tool to convert Tiled Map XML (tmx) files to Hikari-compatible JSON map files. 4 | -------------------------------------------------------------------------------- /engine/src/hikari/client/game/Effect.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/Effect.hpp" 2 | 3 | namespace hikari { 4 | 5 | Effect::~Effect() { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/containerlistener.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/containerlistener.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/selectionlistener.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/selectionlistener.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/container.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/container.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/scrollarea.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/scrollarea.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/tabbedarea.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/tabbedarea.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/textfield.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/textfield.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/imagebutton.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/imagebutton.hpp -------------------------------------------------------------------------------- /extlibs/guichan/include/guichan/widgets/radiobutton.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hakase-labs/hikari/HEAD/extlibs/guichan/include/guichan/widgets/radiobutton.hpp -------------------------------------------------------------------------------- /engine/src/hikari/core/Hikari.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/Hikari.hpp" 2 | 3 | extern "C" 4 | { 5 | const char* hkrHikariVersion() { 6 | return "0.1"; 7 | } 8 | } -------------------------------------------------------------------------------- /engine/src/hikari/client/game/Task.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/Task.hpp" 2 | 3 | namespace hikari { 4 | 5 | Task::~Task() { 6 | // Do nothing! 7 | } 8 | 9 | } // hikari -------------------------------------------------------------------------------- /engine/src/hikari/client/Main.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/Main.hpp" 2 | #include "hikari/client/Client.hpp" 3 | 4 | int main(int argc, char** argv) { 5 | return hikari::Client(argc, argv).run(); 6 | } 7 | -------------------------------------------------------------------------------- /extlibs/guichan-sfml/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | -------------------------------------------------------------------------------- /extlibs/jsoncpp/README.md: -------------------------------------------------------------------------------- 1 | # jsoncpp 2 | 3 | This is a stripped-down version of the JsonCpp library by Baptiste Lepilleur . Find out more about this library at http://jsoncpp.sourceforge.net/. -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/EventData.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/EventData.hpp" 2 | 3 | namespace hikari { 4 | 5 | EventData::~EventData() { 6 | // Do nothing! 7 | } 8 | 9 | } // hikari -------------------------------------------------------------------------------- /extlibs/guichan-hakase/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | -------------------------------------------------------------------------------- /content/assets/tilesets/tiles-dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "surface" : "assets/images/tile-dev.png", 3 | "size" : 16, 4 | "tiles" : [ 5 | { "x" : 0, "y" : 0 }, 6 | { "x" : 16, "y" : 0 }, 7 | { "x" : 0, "y" : 16 }, 8 | { "x" : 16, "y" : 16 } 9 | ] 10 | } 11 | 12 | -------------------------------------------------------------------------------- /extlibs/jsoncpp/include/json/json.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_JSON_H_INCLUDED 2 | # define JSON_JSON_H_INCLUDED 3 | 4 | # include "autolink.h" 5 | # include "value.h" 6 | # include "reader.h" 7 | # include "writer.h" 8 | # include "features.h" 9 | 10 | #endif // JSON_JSON_H_INCLUDED 11 | -------------------------------------------------------------------------------- /engine/include/hikari/client/Main.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Main program entry point. 3 | * 4 | * @param argc the argument count 5 | * @param argv c-style string containing program arguments 6 | * @return program status; 0 means no errors, anything else is bad 7 | */ 8 | int main(int argc, char** argv); -------------------------------------------------------------------------------- /engine/include/hikari/core/math/FixedPoint.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_MATH_FIXEDPOINT 2 | #define HIKARI_CORE_MATH_FIXEDPOINT 3 | 4 | #include 5 | 6 | namespace hikari { 7 | 8 | typedef numeric::Fixed<24, 8> FixedPoint; 9 | 10 | } 11 | 12 | #endif // HIKARI_CORE_MATH_FIXEDPOINT -------------------------------------------------------------------------------- /engine/src/hikari/client/game/objects/HitBox.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/HitBox.hpp" 2 | 3 | namespace hikari { 4 | 5 | HitBox::HitBox(const BoundingBox bounds, bool isShield) 6 | : bounds(bounds) 7 | , shieldFlag(isShield) 8 | { 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /engine/src/hikari/core/util/exception/HikariException.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/util/exception/HikariException.hpp" 2 | 3 | namespace hikari { 4 | 5 | HikariException::HikariException(const std::string& message) 6 | : std::runtime_error(message) 7 | { 8 | 9 | } 10 | 11 | } // hikari -------------------------------------------------------------------------------- /engine/src/hikari/core/game/GameControllerException.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/game/GameControllerException.hpp" 2 | 3 | namespace hikari { 4 | 5 | GameControllerException::GameControllerException(const std::string& what) 6 | : std::runtime_error(what) { 7 | 8 | } 9 | 10 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/core/Hikari.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE 2 | #define HIKARI_CORE 3 | 4 | #include "hikari/core/Platform.hpp" 5 | 6 | extern "C" 7 | { 8 | /** 9 | Gets the version number of Hikari. 10 | */ 11 | HIKARI_API extern const char* hkrHikariVersion(); 12 | } 13 | 14 | #endif // HIKARI_CORE -------------------------------------------------------------------------------- /engine/src/hikari/core/game/AnimationPlaybackException.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/game/AnimationPlaybackException.hpp" 2 | 3 | namespace hikari { 4 | 5 | AnimationPlaybackException::AnimationPlaybackException(const std::string& what) 6 | : std::runtime_error(what) { 7 | 8 | } 9 | 10 | } // hikari -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/EventBus.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/EventBus.hpp" 2 | 3 | namespace hikari { 4 | 5 | EventBus::EventBus(const std::string & name, bool setAsGlobal) { 6 | 7 | } 8 | 9 | EventBus::~EventBus() { 10 | // Do nothing! 11 | } 12 | 13 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/client/game/DamageKey.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_DAMAGEKEY 2 | #define HIKARI_CLIENT_GAME_DAMAGEKEY 3 | 4 | namespace hikari { 5 | 6 | struct DamageKey { 7 | int damagerType; 8 | int damageeType; 9 | }; 10 | 11 | } // hikari 12 | 13 | #endif // HIKARI_CLIENT_GAME_DAMAGEKEY 14 | -------------------------------------------------------------------------------- /MISC.md: -------------------------------------------------------------------------------- 1 | ## Defines ## 2 | 3 | `HIKARI_DEBUG_HERO_PHYSICS` Used to add additional counts for physics of the hero, to make sure the physical properties of the environment are correct. 4 | 5 | `HIKARI_DEBUG_ENTITIES` Used to control whether debug information is made available at runtime. Allows entity bounding boxes to be rendered, things like that. -------------------------------------------------------------------------------- /engine/include/hikari/client/game/Direction.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_DIRECTION 2 | #define HIKARI_CLIENT_GAME_DIRECTION 3 | 4 | namespace hikari { 5 | namespace Direction { 6 | 7 | enum Enum { 8 | LEFT, 9 | RIGHT 10 | }; 11 | 12 | } // hikari::Direction 13 | } // hikari 14 | 15 | #endif // HIKARI_CLIENT_GAME_DIRECTION -------------------------------------------------------------------------------- /engine/src/hikari/core/game/Faction.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/Faction.hpp" 2 | 3 | namespace hikari { 4 | 5 | const Faction Factions::World = Faction(0); 6 | const Faction Factions::Hero = Faction(1); 7 | const Faction Factions::Enemy = Faction(2); 8 | 9 | Factions::Factions() { 10 | 11 | } 12 | 13 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/core/Platform.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_PLATFORM 2 | #define HIKARI_CORE_PLATFORM 3 | 4 | #if defined(_MSC_VER) && defined(HIKARI_LIBRARY_BUILD) 5 | #define HIKARI_API _declspec(dllexport) 6 | #else 7 | #define HIKARI_API 8 | #endif 9 | 10 | #ifndef HIKARI_API 11 | #define HIKARI_API 12 | #endif 13 | 14 | #endif // HIKARI_CORE_PLATFORM -------------------------------------------------------------------------------- /engine/src/hikari/core/util/exception/ServiceNotRegisteredException.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/util/exception/ServiceNotRegisteredException.hpp" 2 | 3 | namespace hikari { 4 | 5 | ServiceNotRegisteredException::ServiceNotRegisteredException(const std::string& message) 6 | : HikariException(message) 7 | { 8 | 9 | } 10 | 11 | } // hikari -------------------------------------------------------------------------------- /extlibs/squirrel/include/sqstdmath.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_MATH_H_ 3 | #define _SQSTD_MATH_H_ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | SQUIRREL_API SQRESULT sqstd_register_mathlib(HSQUIRRELVM v); 10 | 11 | #ifdef __cplusplus 12 | } /*extern "C"*/ 13 | #endif 14 | 15 | #endif /*_SQSTD_MATH_H_*/ 16 | -------------------------------------------------------------------------------- /extlibs/squirrel/include/sqstdsystem.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_SYSTEMLIB_H_ 3 | #define _SQSTD_SYSTEMLIB_H_ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | SQUIRREL_API SQInteger sqstd_register_systemlib(HSQUIRRELVM v); 10 | 11 | #ifdef __cplusplus 12 | } /*extern "C"*/ 13 | #endif 14 | 15 | #endif /* _SQSTD_SYSTEMLIB_H_ */ 16 | -------------------------------------------------------------------------------- /engine/include/hikari/core/math/Constants.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_MATH_CONSTANTS_HPP 2 | #define HIKARI_CORE_MATH_CONSTANTS_HPP 3 | 4 | namespace hikari { 5 | namespace math { 6 | namespace constants { 7 | 8 | const float PI = 3.141592654F; /* 3.14159265458979323846 */ 9 | 10 | } // hikari::math::constants 11 | } // hikari::math 12 | } // hikari 13 | 14 | #endif // HIKARI_CORE_MATH_CONSTANTS_HPP 15 | -------------------------------------------------------------------------------- /extlibs/gme-nes/README.md: -------------------------------------------------------------------------------- 1 | gme-nes 2 | ======= 3 | 4 | This is a stripped-down version of Blargg's Game Music Emulator. Normally GME supports many different formats but all have been removed except NES (NSF/NSFE). 5 | 6 | Hakase Labs is not the original author if this software. This software is licensed under the Lesser GNU Public License. You can find the original source code at http://slack.net/~ant/libs/audio.html. -------------------------------------------------------------------------------- /engine/src/hikari/client/game/objects/BlockTiming.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/BlockTiming.hpp" 2 | 3 | namespace hikari { 4 | BlockTiming::BlockTiming(const std::vector & blockIndicies) 5 | : blockIndicies(blockIndicies) 6 | { 7 | 8 | } 9 | 10 | const std::vector & BlockTiming::getBlockIndicies() const { 11 | return blockIndicies; 12 | } 13 | } // hikari 14 | -------------------------------------------------------------------------------- /engine/include/hikari/client/gui/Orientation.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GUI_ORIENTATION 2 | #define HIKARI_CLIENT_GUI_ORIENTATION 3 | 4 | namespace hikari { 5 | namespace gui { 6 | namespace Orientation { 7 | 8 | enum Type { 9 | HORIZONTAL = 0, 10 | VERTICAL = 1 11 | }; 12 | 13 | } // hikari::gui::Orientation 14 | } // hikari::gui 15 | } // hikari 16 | 17 | #endif // HIKARI_CLIENT_GUI_ORIENTATION -------------------------------------------------------------------------------- /engine/include/hikari/core/util/Service.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_SERVICE_HPP 2 | #define HIKARI_CORE_UTIL_SERVICE_HPP 3 | 4 | #include "hikari/core/Platform.hpp" 5 | 6 | namespace hikari { 7 | 8 | /** 9 | Interface for all services. 10 | */ 11 | class HIKARI_API Service { 12 | public: 13 | virtual ~Service() { } 14 | }; 15 | 16 | } // hikari 17 | 18 | #endif // HIKARI_CORE_UTIL_SERVICE_HPP -------------------------------------------------------------------------------- /content/assets/fonts.json: -------------------------------------------------------------------------------- 1 | { 2 | "gui" : { 3 | "image" : "assets/images/gui-font.png", 4 | "glyphs" : " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 5 | "width" : 8, 6 | "height" : 8 7 | }, 8 | "menu" : { 9 | "image" : "assets/images/menu-font.png", 10 | "glyphs" : " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 11 | "width" : 8, 12 | "height" : 8 13 | } 14 | } -------------------------------------------------------------------------------- /extlibs/squirrel/include/sqstdaux.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_AUXLIB_H_ 3 | #define _SQSTD_AUXLIB_H_ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | SQUIRREL_API void sqstd_seterrorhandlers(HSQUIRRELVM v); 10 | SQUIRREL_API void sqstd_printcallstack(HSQUIRRELVM v); 11 | 12 | #ifdef __cplusplus 13 | } /*extern "C"*/ 14 | #endif 15 | 16 | #endif /* _SQSTD_AUXLIB_H_ */ 17 | -------------------------------------------------------------------------------- /engine/include/hikari/core/util/JsonUtils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_JSONUTILS 2 | #define HIKARI_CORE_UTIL_JSONUTILS 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include 6 | #include 7 | 8 | namespace hikari { 9 | 10 | class HIKARI_API JsonUtils { 11 | public: 12 | static Json::Value loadJson(const std::string &fileName); 13 | }; 14 | 15 | } // hikari 16 | 17 | #endif // HIKARI_CORE_UTIL_JSONUTILS -------------------------------------------------------------------------------- /engine/src/hikari/core/util/RedirectStream.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/util/RedirectStream.hpp" 2 | 3 | namespace hikari { 4 | 5 | RedirectStream::RedirectStream(std::ios& from, std::ios& to) 6 | : fromStream(&from) 7 | , fromBuffer(from.rdbuf()) 8 | { 9 | fromStream->rdbuf(to.rdbuf()); 10 | } 11 | 12 | RedirectStream::~RedirectStream() { 13 | fromStream->rdbuf(fromBuffer); 14 | } 15 | 16 | } // hikari -------------------------------------------------------------------------------- /content/assets/scripts/effects/ExtraLifeEffect.nut: -------------------------------------------------------------------------------- 1 | class ExtraLifeEffect extends EffectBase { 2 | constructor(config = { }) { 3 | base.constructor(config); 4 | } 5 | 6 | function applyEffect() { 7 | ::hikari.game.setLives(::hikari.game.getLives() + 1); 8 | ::hikari.sound.playSample("Power Up"); 9 | } 10 | 11 | function unapplyEffect() { 12 | ::hikari.game.setLives(::hikari.game.getLives() - 1); 13 | } 14 | } -------------------------------------------------------------------------------- /engine/src/hikari/client/game/objects/Motion.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/Motion.hpp" 2 | 3 | namespace hikari { 4 | 5 | Motion::Motion() { 6 | 7 | } 8 | 9 | Motion::Motion(const Motion & proto) { 10 | 11 | } 12 | 13 | Motion::~Motion() { 14 | 15 | } 16 | 17 | Vector2 Motion::calculate(float dt, const Vector2 & previousVelocity) { 18 | return previousVelocity; 19 | } 20 | 21 | } // hikari -------------------------------------------------------------------------------- /extlibs/squirrel/squirrel/sqmem.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | see copyright notice in squirrel.h 3 | */ 4 | #include "sqpcheader.h" 5 | #ifndef SQ_EXCLUDE_DEFAULT_MEMFUNCTIONS 6 | void *sq_vm_malloc(SQUnsignedInteger size){ return malloc(size); } 7 | 8 | void *sq_vm_realloc(void *p, SQUnsignedInteger SQ_UNUSED_ARG(oldsize), SQUnsignedInteger size){ return realloc(p, size); } 9 | 10 | void sq_vm_free(void *p, SQUnsignedInteger SQ_UNUSED_ARG(size)){ free(p); } 11 | #endif 12 | -------------------------------------------------------------------------------- /engine/include/hikari/core/game/map/camera/CameraStrategy.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_MAP_CAMERA_CAMERASTRATEGY 2 | #define HIKARI_CORE_GAME_MAP_CAMERA_CAMERASTRATEGY 3 | 4 | #include "hikari/core/Platform.hpp" 5 | 6 | namespace hikari { 7 | 8 | class HIKARI_API CameraStrategy { 9 | public: 10 | virtual ~CameraStrategy() {} 11 | virtual void execute(); 12 | }; 13 | 14 | } // hikari 15 | 16 | #endif // HIKARI_CORE_GAME_MAP_CAMERA_CAMERASTRATEGY -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/HeroIdleMobilityState.hpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/Hero.hpp" 2 | 3 | namespace hikari { 4 | 5 | class Hero::IdleMobilityState : public Hero::MobilityState { 6 | public: 7 | IdleMobilityState(Hero & hero); 8 | virtual ~IdleMobilityState(); 9 | virtual void enter(); 10 | virtual void exit(); 11 | virtual StateChangeAction update(const float & dt); 12 | }; 13 | 14 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/core/util/Cloneable.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_CLONEABLE 2 | #define HIKARI_CORE_UTIL_CLONEABLE 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include 6 | 7 | namespace hikari { 8 | 9 | template 10 | class HIKARI_API Cloneable { 11 | public: 12 | virtual ~Cloneable() { } 13 | protected: 14 | virtual std::unique_ptr clone() const = 0; 15 | }; 16 | } 17 | 18 | #endif // HIKARI_CORE_UTIL_CLONEABLE -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/HeroAirbornMobilityState.hpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/Hero.hpp" 2 | 3 | namespace hikari { 4 | 5 | class Hero::AirbornMobilityState : public Hero::MobilityState { 6 | public: 7 | AirbornMobilityState(Hero & hero); 8 | virtual ~AirbornMobilityState(); 9 | virtual void enter(); 10 | virtual void exit(); 11 | virtual StateChangeAction update(const float & dt); 12 | }; 13 | 14 | } // hikari -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/BaseEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/BaseEventData.hpp" 2 | 3 | namespace hikari { 4 | 5 | BaseEventData::BaseEventData(const EventTime timeStamp) 6 | : EventData() 7 | , timeStamp(timeStamp) 8 | { 9 | 10 | } 11 | 12 | BaseEventData::~BaseEventData() { 13 | // Do nothing! 14 | } 15 | 16 | EventTime BaseEventData::getTimeStamp() const { 17 | return timeStamp; 18 | } 19 | 20 | } // hikari -------------------------------------------------------------------------------- /content/assets/scripts/effects/AddETankEffect.nut: -------------------------------------------------------------------------------- 1 | class AddETankEffect extends EffectBase { 2 | constructor(config = { }) { 3 | base.constructor(config); 4 | } 5 | 6 | function applyEffect() { 7 | ::hikari.game.setETanks(::hikari.game.getETanks() + 1); 8 | ::hikari.sound.playSample("Power Up"); 9 | } 10 | 11 | function unapplyEffect() { 12 | ::hikari.game.setETanks(::hikari.game.getETanks() - 1); 13 | } 14 | } 15 | 16 | ::log("AddETankEffect processed!"); -------------------------------------------------------------------------------- /content/damage.json: -------------------------------------------------------------------------------- 1 | { 2 | "damage": [ 3 | { 4 | "id": 0, 5 | "amount": 0.0 6 | }, 7 | { 8 | "id": 1, 9 | "amount": 10.0 10 | }, 11 | { 12 | "id": 2, 13 | "amount": 4.0 14 | }, 15 | { 16 | "id": 4, 17 | "amount": 6.0 18 | }, 19 | { 20 | "id": 7, 21 | "amount": 1.0 22 | } 23 | ], 24 | "buffs": [ 25 | ] 26 | } -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/HitBox.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECT_HITBOX 2 | #define HIKARI_CLIENT_GAME_OBJECT_HITBOX 3 | 4 | #include "hikari/core/geom/BoundingBox.hpp" 5 | 6 | namespace hikari { 7 | 8 | struct HitBox { 9 | BoundingBox bounds; 10 | bool shieldFlag; 11 | 12 | HitBox(const BoundingBox bounds = BoundingBox(0, 0, 0, 0), bool isShield = false); 13 | }; 14 | 15 | 16 | } 17 | 18 | #endif // HIKARI_CLIENT_GAME_OBJECT_HITBOX 19 | -------------------------------------------------------------------------------- /engine/src/hikari/client/game/WaitTask.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/WaitTask.hpp" 2 | 3 | namespace hikari { 4 | WaitTask::WaitTask(float threshold) 5 | : BaseTask(0, Task::TYPE_BLOCKING) 6 | , threshold(threshold) 7 | { 8 | 9 | } 10 | 11 | WaitTask::~WaitTask() { 12 | 13 | } 14 | 15 | void WaitTask::update(float dt) { 16 | threshold -= dt; 17 | 18 | if(threshold <= 0) { 19 | markAsCompleted(); 20 | } 21 | } 22 | 23 | } // hikari 24 | -------------------------------------------------------------------------------- /extlibs/squirrel/squirrel/sqpcheader.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQPCHEADER_H_ 3 | #define _SQPCHEADER_H_ 4 | 5 | #if defined(_MSC_VER) && defined(_DEBUG) 6 | #include 7 | #endif 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | //squirrel stuff 16 | #include 17 | #include "sqobject.h" 18 | #include "sqstate.h" 19 | 20 | #endif //_SQPCHEADER_H_ 21 | -------------------------------------------------------------------------------- /content/conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "vsync" : true, 3 | "videoMode" : "2x", 4 | "showfps" : true, 5 | "audio": { 6 | "samples": 0, 7 | "music": 0 8 | }, 9 | "bindings" : { 10 | "keyboard" : { 11 | "up" : "up", 12 | "right" : "right", 13 | "down" : "down", 14 | "left" : "left", 15 | "jump" : "a", 16 | "shoot" : "s" 17 | } 18 | }, 19 | "scripting" : { 20 | "stackSize" : 2048 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/WaitTask.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_WAITTASK 2 | #define HIKARI_CLIENT_GAME_WAITTASK 3 | 4 | #include "hikari/client/game/BaseTask.hpp" 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class WaitTask : public BaseTask { 10 | private: 11 | float threshold; 12 | 13 | public: 14 | WaitTask(float threshold); 15 | virtual ~WaitTask(); 16 | 17 | virtual void update(float dt); 18 | }; 19 | 20 | } // hikari 21 | 22 | #endif // HIKARI_CLIENT_GAME_WAITTASK -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/BlockTiming.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_BLOCKTIMING 2 | #define HIKARI_CLIENT_GAME_OBJECTS_BLOCKTIMING 3 | 4 | #include 5 | 6 | namespace hikari { 7 | class BlockTiming { 8 | private: 9 | std::vector blockIndicies; 10 | 11 | public: 12 | explicit BlockTiming(const std::vector & blockIndicies); 13 | const std::vector & getBlockIndicies() const; 14 | }; 15 | } // hikari 16 | 17 | #endif // HIKARI_CLIENT_GAME_OBJECTS_BLOCKTIMING 18 | -------------------------------------------------------------------------------- /extlibs/jsoncpp/include/json/autolink.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_AUTOLINK_H_INCLUDED 2 | # define JSON_AUTOLINK_H_INCLUDED 3 | 4 | # include "config.h" 5 | 6 | # ifdef JSON_IN_CPPTL 7 | # include 8 | # endif 9 | 10 | # if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && !defined(JSON_IN_CPPTL) 11 | # define CPPTL_AUTOLINK_NAME "json" 12 | # undef CPPTL_AUTOLINK_DLL 13 | # ifdef JSON_DLL 14 | # define CPPTL_AUTOLINK_DLL 15 | # endif 16 | # include "autolink.h" 17 | # endif 18 | 19 | #endif // JSON_AUTOLINK_H_INCLUDED 20 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/Motion.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_MOTION 2 | #define HIKARI_CLIENT_GAME_OBJECTS_MOTION 3 | 4 | #include "hikari/core/math/Vector2.hpp" 5 | 6 | namespace hikari { 7 | 8 | class Motion { 9 | public: 10 | Motion(); 11 | Motion(const Motion & proto); 12 | virtual ~Motion(); 13 | 14 | virtual Vector2 calculate(float dt, const Vector2 & previousVelocity = Vector2()); 15 | }; 16 | 17 | } // hikari 18 | 19 | #endif // HIKARI_CLIENT_GAME_OBJECTS_MOTION 20 | -------------------------------------------------------------------------------- /engine/include/hikari/client/gui/BossMenu.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GUI_BOSSMENU 2 | #define HIKARI_CORE_GUI_BOSSMENU 3 | 4 | #include "hikari/client/gui/Widget.hpp" 5 | #include 6 | #include 7 | #include 8 | 9 | namespace hikari { 10 | 11 | class BossMenu : public Widget { 12 | private: 13 | int selectedIndex; 14 | std::vector validIndicies; 15 | sf::Sprite background; 16 | sf::Sprite frame; 17 | }; 18 | 19 | } // hikari 20 | 21 | #endif // HIKARI_CORE_GUI_BOSSMENU -------------------------------------------------------------------------------- /extlibs/gme-nes/gme_types.h: -------------------------------------------------------------------------------- 1 | #ifndef GME_TYPES_H 2 | #define GME_TYPES_H 3 | 4 | /* 5 | * This is a default gme_types.h for use when *not* using 6 | * CMake. If CMake is in use gme_types.h.in will be 7 | * processed instead. 8 | */ 9 | #define USE_GME_AY 0 10 | #define USE_GME_GBS 0 11 | #define USE_GME_GYM 0 12 | #define USE_GME_HES 0 13 | #define USE_GME_KSS 0 14 | #define USE_GME_NSF 15 | #define USE_GME_NSFE 16 | #define USE_GME_SAP 0 17 | #define USE_GME_SPC 0 18 | /* VGM and VGZ are a package deal */ 19 | #define USE_GME_VGM 0 20 | 21 | #endif /* GME_TYPES_H */ 22 | -------------------------------------------------------------------------------- /extlibs/guichan-sfml/include/guichan/sfml.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GCN_SFML_HPP 2 | #define GCN_SFML_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "platform.hpp" 11 | 12 | extern "C" 13 | { 14 | /** 15 | * Exists to be able to check for Guichan SFML with autotools. 16 | */ 17 | GCN_EXTENSION_DECLSPEC extern void gcnSFML(); 18 | } 19 | 20 | #endif // end GCN_SFML_HPP 21 | -------------------------------------------------------------------------------- /ISSUES.md: -------------------------------------------------------------------------------- 1 | # Known Issues ## 2 | 3 | ## Windows ### 4 | 5 | ### Error executing: "The application was unable to start correctly (0x000007b)" ### 6 | This is most likely due to a 32-bit/64-bit mismatch between the compiled executable and the `.dll` files it depends on. You can confirm this with a tool like [Dependency Walker](https://en.wikipedia.org/wiki/Dependency_Walker). It may be that the copy of `libsndfile-1.dll` and `openal32.dll` don't match the architecture (bit-wise) of the compiled executable. A remedy is to copy the `.dll` files of the correct architecture to your exectuable's output directory. -------------------------------------------------------------------------------- /engine/src/hikari/client/gui/Widget.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/gui/Widget.hpp" 2 | 3 | namespace hikari { 4 | namespace gui { 5 | 6 | const sf::Vector2i& Widget::getPosition() const { 7 | return position; 8 | } 9 | 10 | void Widget::setPosition(const sf::Vector2i &newPosition) { 11 | position = newPosition; 12 | } 13 | 14 | const bool& Widget::isVisible() const { 15 | return visible; 16 | } 17 | 18 | void Widget::setVisible(const bool &isVisible) { 19 | visible = isVisible; 20 | } 21 | 22 | } // hikari::gui 23 | } // hikari -------------------------------------------------------------------------------- /tools/map-converter/dev-tiles.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /engine/include/hikari/core/game/map/camera/FollowingCameraStrategy.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_MAP_CAMERA_FOLLOWINGCAMERASTRATEGY 2 | #define HIKARI_CORE_GAME_MAP_CAMERA_FOLLOWINGCAMERASTRATEGY 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/game/map/camera/CameraStrategy.hpp" 6 | 7 | namespace hikari { 8 | 9 | class HIKARI_API FollowingCameraStrategy : public CameraStrategy { 10 | public: 11 | virtual ~FollowingCameraStrategy() {} 12 | virtual void execute(); 13 | }; 14 | 15 | } // hikari 16 | 17 | #endif // HIKARI_CORE_GAME_MAP_CAMERA_FOLLOWINGCAMERASTRATEGY -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/HeroSlidingMobilityState.hpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/Hero.hpp" 2 | 3 | namespace hikari { 4 | 5 | class Hero::SlidingMobilityState : public Hero::MobilityState { 6 | private: 7 | float slideDuration; 8 | float slideDurationThreshold; 9 | BoundingBoxF oldBoundingBox; 10 | public: 11 | SlidingMobilityState(Hero & hero); 12 | virtual ~SlidingMobilityState(); 13 | virtual void enter(); 14 | virtual void exit(); 15 | virtual StateChangeAction update(const float & dt); 16 | }; 17 | 18 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/client/game/Effect.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_EFFECT 2 | #define HIKARI_CLIENT_GAME_EFFECT 3 | 4 | #include "hikari/core/util/Cloneable.hpp" 5 | #include 6 | 7 | namespace hikari { 8 | 9 | /** 10 | Interface for game propery changing effects (extra life, weapon energy, etc.) 11 | */ 12 | class Effect { 13 | public: 14 | virtual std::shared_ptr clone() const = 0; 15 | virtual ~Effect(); 16 | virtual void apply() = 0; 17 | virtual void unapply() = 0; 18 | }; 19 | 20 | } // hikari 21 | 22 | #endif // HIKARI_CLIENT_GAME_EFFECT -------------------------------------------------------------------------------- /engine/include/hikari/core/game/Direction.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_DIRECTION 2 | #define HIKARI_CORE_GAME_DIRECTION 3 | 4 | namespace hikari { 5 | 6 | typedef int Direction; 7 | 8 | class Directions { 9 | public: 10 | static const Direction None; 11 | static const Direction Up; 12 | static const Direction Right; 13 | static const Direction Down; 14 | static const Direction Left; 15 | 16 | static Direction opposite(const Direction& dir); 17 | private: 18 | Directions(); 19 | }; 20 | 21 | } // hikari 22 | 23 | #endif // HIKARI_CORE_GAME_DIRECTION -------------------------------------------------------------------------------- /engine/include/hikari/client/game/PaletteHelpers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_PALETTEHELPERS 2 | #define HIKARI_CLIENT_GAME_PALETTEHELPERS 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | namespace hikari { 10 | 11 | namespace PaletteHelpers { 12 | 13 | /** 14 | * Loads a palette from the specified file and returns it as a vector of 15 | * palette entries. 16 | */ 17 | std::vector> loadPaletteFile(const std::string & filePath); 18 | 19 | } // hikari::PaletteHelpers 20 | } // hikari 21 | 22 | #endif // HIKARI_CLIENT_GAME_PALETTEHELPERS -------------------------------------------------------------------------------- /extlibs/squirrel/include/sqstdblob.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTDBLOB_H_ 3 | #define _SQSTDBLOB_H_ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | SQUIRREL_API SQUserPointer sqstd_createblob(HSQUIRRELVM v, SQInteger size); 10 | SQUIRREL_API SQRESULT sqstd_getblob(HSQUIRRELVM v,SQInteger idx,SQUserPointer *ptr); 11 | SQUIRREL_API SQInteger sqstd_getblobsize(HSQUIRRELVM v,SQInteger idx); 12 | 13 | SQUIRREL_API SQRESULT sqstd_register_bloblib(HSQUIRRELVM v); 14 | 15 | #ifdef __cplusplus 16 | } /*extern "C"*/ 17 | #endif 18 | 19 | #endif /*_SQSTDBLOB_H_*/ 20 | 21 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/HeroDamagedMobilityState.hpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/Hero.hpp" 2 | #include "hikari/core/math/Vector2.hpp" 3 | 4 | namespace hikari { 5 | 6 | class Hero::DamagedMobilityState : public Hero::MobilityState { 7 | private: 8 | float stunnedTimer; 9 | Vector2 horizontalVelocity; 10 | 11 | public: 12 | DamagedMobilityState(Hero & hero); 13 | virtual ~DamagedMobilityState(); 14 | virtual void enter(); 15 | virtual void exit(); 16 | virtual StateChangeAction update(const float & dt); 17 | }; 18 | 19 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/client/gui/IconAnimator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_ICONANIMATOR 2 | #define HIKARI_CORE_GAME_ICONANIMATOR 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/game/Animator.hpp" 6 | 7 | namespace hikari { 8 | namespace gui { 9 | 10 | class Icon; 11 | 12 | class HIKARI_API IconAnimator : public Animator { 13 | private: 14 | Icon & icon; 15 | 16 | public: 17 | IconAnimator(Icon & icon); 18 | virtual ~IconAnimator(); 19 | virtual void update(float delta); 20 | }; 21 | 22 | } // gui 23 | } // hikari 24 | 25 | #endif // HIKARI_CORE_GAME_ICONANIMATOR -------------------------------------------------------------------------------- /engine/include/hikari/core/util/exception/HikariException.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_HIKARIEXCEPTION 2 | #define HIKARI_CORE_UTIL_HIKARIEXCEPTION 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include 6 | #include 7 | 8 | namespace hikari { 9 | 10 | /** 11 | Base class for all Hikari-specific exceptions. 12 | */ 13 | class HIKARI_API HikariException : public std::runtime_error { 14 | public: 15 | explicit HikariException(const std::string& message); 16 | virtual ~HikariException() throw() { } 17 | }; 18 | 19 | } // hikari 20 | 21 | #endif // HIKARI_CORE_UTIL_HIKARIEXCEPTION -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/HeroWalkingMobilityState.hpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/Hero.hpp" 2 | 3 | namespace hikari { 4 | 5 | class Hero::WalkingMobilityState : public Hero::MobilityState { 6 | private: 7 | int accelerationDelay; 8 | int accelerationDelayThreshold; 9 | bool isDecelerating; 10 | Direction lastDirection; 11 | public: 12 | WalkingMobilityState(Hero & hero); 13 | virtual ~WalkingMobilityState(); 14 | virtual void enter(); 15 | virtual void exit(); 16 | virtual StateChangeAction update(const float & dt); 17 | }; 18 | 19 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/BaseEventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_BASEEVENTDATA 2 | #define HIKARI_CLIENT_BASEEVENTDATA 3 | 4 | #include "hikari/client/game/events/EventData.hpp" 5 | 6 | namespace hikari { 7 | 8 | class BaseEventData : public EventData { 9 | private: 10 | const EventTime timeStamp; 11 | 12 | public: 13 | explicit BaseEventData(const EventTime timeStamp = 0.0f); 14 | virtual ~BaseEventData(); 15 | 16 | virtual const EventType & getEventType() const = 0; 17 | 18 | virtual EventTime getTimeStamp() const; 19 | }; 20 | 21 | } // hikari 22 | 23 | #endif // HIKARI_CLIENT_BASEEVENTDATA -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/HeroClimbingMobilityState.hpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/Hero.hpp" 2 | #include "hikari/core/geom/BoundingBox.hpp" 3 | 4 | namespace hikari { 5 | 6 | class Hero::ClimbingMobilityState : public Hero::MobilityState { 7 | private: 8 | const BoundingBox climbableRegion; 9 | 10 | public: 11 | ClimbingMobilityState(Hero & hero, const BoundingBox & climbableRegion); 12 | virtual ~ClimbingMobilityState(); 13 | virtual void enter(); 14 | virtual void exit(); 15 | virtual StateChangeAction update(const float & dt); 16 | }; 17 | 18 | } // hikari -------------------------------------------------------------------------------- /content/assets/animations/stage-select.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Stage Select Portraits", 3 | "image": "assets/images/fg-stage-select.png", 4 | "animations": { 5 | "default": { 6 | "repeat": true, 7 | "keyframe": 0, 8 | "syncGroup": 0, 9 | "frames": [ 10 | { 11 | "x" : 31, 12 | "y" : 40, 13 | "width" : 32, 14 | "height" : 32, 15 | "hotspotX" : 0, 16 | "hotspotY" : 0, 17 | "length" : 0.1333 18 | } 19 | ] 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /engine/include/hikari/core/util/exception/ServiceNotRegisteredException.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_EXCEPTION_SERVICENOTREGISTEREDEXCEPTION 2 | #define HIKARI_CORE_UTIL_EXCEPTION_SERVICENOTREGISTEREDEXCEPTION 3 | 4 | #include "hikari/core/util/exception/HikariException.hpp" 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class HIKARI_API ServiceNotRegisteredException : public HikariException { 10 | public: 11 | explicit ServiceNotRegisteredException(const std::string& messages); 12 | virtual ~ServiceNotRegisteredException() throw() { } 13 | }; 14 | 15 | } // hikari 16 | 17 | #endif // HIKARI_CORE_UTIL_EXCEPTION_SERVICENOTREGISTEREDEXCEPTION -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/effects/NothingEffect.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_EFFECTS_NOTHINGEFFECT 2 | #define HIKARI_CLIENT_GAME_OBJECTS_EFFECTS_NOTHINGEFFECT 3 | 4 | #include "hikari/client/game/Effect.hpp" 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class NothingEffect : public Effect { 10 | public: 11 | NothingEffect(); 12 | NothingEffect(const NothingEffect &proto); 13 | virtual std::shared_ptr clone() const; 14 | virtual ~NothingEffect(); 15 | virtual void apply(); 16 | virtual void unapply(); 17 | }; 18 | 19 | } // hikari 20 | 21 | #endif // HIKARI_CLIENT_GAME_OBJECTS_EFFECTS_NOTHINGEFFECT -------------------------------------------------------------------------------- /tools/map-converter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tmx-to-json", 3 | "main": "tmx2json.js", 4 | "description": "Tiled map .TMX to Hikari format map .JSON converter", 5 | "version": "0.0.1a", 6 | "keywords": [ 7 | "hikari", 8 | "tiled" 9 | ], 10 | "homepage": "https://github.com/hakase-labs/hikari", 11 | "bugs": { 12 | "url": "https://github.com/hakase-labs/hikari/issues" 13 | }, 14 | "engines": { 15 | "node": ">=0.10.0" 16 | }, 17 | "dependencies": { 18 | "deepmerge": "~0.2.7", 19 | "lodash": "^2.4.1", 20 | "rsvp": "~3.0.13", 21 | "xml2js": "~0.4.4" 22 | }, 23 | "devDependencies": { 24 | "mocha": "~1.18.2", 25 | "sinon": "1.3.4" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /engine/include/hikari/core/game/Updatable.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_UPDATABLE 2 | #define HIKARI_CLIENT_GAME_UPDATABLE 3 | 4 | namespace hikari { 5 | 6 | /** 7 | Interface for all things that can be updated over time. 8 | */ 9 | class Updatable { 10 | public: 11 | /** 12 | Virtual destructor; standard stuff. 13 | */ 14 | virtual ~Updatable() { 15 | // no-op 16 | } 17 | 18 | /** 19 | Updates an object by a number of seconds. 20 | 21 | @param dt the number of seconds to update for 22 | */ 23 | virtual void update(float dt) = 0; 24 | }; 25 | 26 | } // hikari 27 | 28 | #endif // HIKARI_CLIENT_GAME_UPDATABLE -------------------------------------------------------------------------------- /engine/include/hikari/client/game/Shot.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_SHOT 2 | #define HIKARI_CLIENT_GAME_SHOT 3 | 4 | #include 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class GameObject; 10 | 11 | class Shot { 12 | private: 13 | std::list> trackedObjects; 14 | 15 | public: 16 | explicit Shot(std::list> trackedObjects); 17 | Shot(const Shot & proto); 18 | 19 | /** 20 | * Returns whether the shot is active or not. 21 | * 22 | * @return true if the shot is active, false otherwise 23 | */ 24 | bool isActive() const; 25 | }; 26 | } // hikari 27 | 28 | #endif // HIKARI_CLIENT_GAME_SHOT -------------------------------------------------------------------------------- /engine/src/hikari/core/util/AnimationSetCache.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/util/AnimationSetCache.hpp" 2 | #include "hikari/core/game/AnimationLoader.hpp" 3 | #include "hikari/core/util/Log.hpp" 4 | 5 | namespace hikari { 6 | 7 | AnimationSetCache::AnimationSetCache(const std::shared_ptr & loader) 8 | : loader(loader) 9 | { 10 | 11 | } 12 | 13 | AnimationSetCache::Resource AnimationSetCache::loadResource(const std::string &fileName) { 14 | HIKARI_LOG(debug) << "Caching animation set: " << fileName; 15 | 16 | Resource animationSet; 17 | 18 | if(loader) { 19 | animationSet = loader->loadSet(fileName); 20 | } 21 | 22 | return animationSet; 23 | } 24 | 25 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/client/game/FunctionTask.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_FUNCTIONTASK 2 | #define HIKARI_CLIENT_GAME_FUNCTIONTASK 3 | 4 | #include "hikari/client/game/BaseTask.hpp" 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class FunctionTask : public BaseTask { 10 | public: 11 | typedef std::function TaskFunction; 12 | 13 | private: 14 | TaskFunction func; 15 | 16 | public: 17 | FunctionTask(int priority, TaskFunction taskFunction); 18 | FunctionTask(int priority, SequenceType type, TaskFunction taskFunction); 19 | virtual ~FunctionTask(); 20 | 21 | virtual void update(float dt); 22 | }; 23 | 24 | } // hikari 25 | 26 | #endif // HIKARI_CLIENT_GAME_FUNCTIONTASK -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/TransitionCollisionEventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_TRANSITIONCOLLISIONEVENTDATA 2 | #define HIKARI_CLIENT_TRANSITIONCOLLISIONEVENTDATA 3 | 4 | #include "hikari/client/game/events/BaseEventData.hpp" 5 | 6 | namespace hikari { 7 | 8 | class TransitionCollisionEventData : public BaseEventData { 9 | public: 10 | static const EventType Type; 11 | 12 | public: 13 | TransitionCollisionEventData(); 14 | virtual ~TransitionCollisionEventData(); 15 | 16 | virtual const EventType & getEventType() const; 17 | 18 | virtual EventDataPtr copy() const; 19 | virtual const char * getName() const; 20 | }; 21 | 22 | } // hikari 23 | 24 | #endif // HIKARI_CLIENT_TRANSITIONCOLLISIONEVENTDATA -------------------------------------------------------------------------------- /engine/src/hikari/client/game/WeaponAction.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/WeaponAction.hpp" 2 | #include "hikari/client/game/GameWorld.hpp" 3 | #include "hikari/client/game/Weapon.hpp" 4 | #include "hikari/client/game/events/WeaponFireEventData.hpp" 5 | #include "hikari/client/game/objects/GameObject.hpp" 6 | 7 | #include "hikari/core/util/Log.hpp" 8 | 9 | namespace hikari { 10 | 11 | WeaponAction::WeaponAction() { 12 | 13 | } 14 | 15 | WeaponAction::~WeaponAction() { 16 | // dtor 17 | } 18 | 19 | std::weak_ptr WeaponAction::apply(GameWorld & world, const Weapon & weapon, WeaponFireEventData & eventData) const { 20 | HIKARI_LOG(debug4) << "WeaponAction::apply executed."; 21 | 22 | return std::weak_ptr(); 23 | } 24 | } // hikari 25 | -------------------------------------------------------------------------------- /engine/src/hikari/client/game/FunctionTask.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/FunctionTask.hpp" 2 | 3 | namespace hikari { 4 | FunctionTask::FunctionTask(int priority, TaskFunction func) 5 | : BaseTask(priority, Task::TYPE_PARALLEL) 6 | , func(func) 7 | { 8 | 9 | } 10 | 11 | FunctionTask::FunctionTask(int priority, SequenceType type, TaskFunction func) 12 | : BaseTask(priority, type) 13 | , func(func) 14 | { 15 | 16 | } 17 | 18 | FunctionTask::~FunctionTask() { 19 | 20 | } 21 | 22 | void FunctionTask::update(float dt) { 23 | if(func) { 24 | bool done = func(dt); 25 | 26 | if(done) { 27 | markAsCompleted(); 28 | } 29 | } 30 | } 31 | 32 | } // hikari 33 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/GOCreationParameters.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_GOCREATIONPARAMETERS 2 | #define HIKARI_CLIENT_GAME_GOCREATIONPARAMETERS 3 | 4 | #include "hikari/client/game/objects/GameObject.hpp" 5 | #include "hikari/client/game/Direction.hpp" 6 | 7 | #include "hikari/core/geom/Point2D.hpp" 8 | 9 | namespace hikari { 10 | 11 | struct GOCreationParameters { 12 | public: 13 | int state; 14 | int health; 15 | int maxHealth; 16 | 17 | float age; 18 | 19 | bool active; 20 | bool affectedByGravity; 21 | 22 | Point2D position; 23 | Point2D velocity; 24 | 25 | Directions::Enum direction; 26 | }; 27 | 28 | } 29 | 30 | #endif // HIKARI_CLIENT_GAME_GOCREATIONPARAMETERS -------------------------------------------------------------------------------- /engine/include/hikari/core/game/GameControllerException.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_GAMECONTROLLEREXCEPTION 2 | #define HIKARI_CORE_GAME_GAMECONTROLLEREXCEPTION 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include 6 | #include 7 | 8 | #if (_WIN32 && _MSC_VER) 9 | #pragma warning(push) 10 | #pragma warning(disable:4275) 11 | #endif 12 | 13 | namespace hikari { 14 | 15 | class HIKARI_API GameControllerException : public std::runtime_error { 16 | public: 17 | explicit GameControllerException(const std::string& what); 18 | virtual ~GameControllerException() throw() { }; 19 | }; 20 | 21 | } // hikari 22 | 23 | #if (_WIN32 && _MSC_VER) 24 | #pragma warning(pop) 25 | #endif 26 | 27 | #endif // HIKARI_CORE_GAME_GAMECONTROLLEREXCEPTION 28 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/HeroTeleportingMobilityState.hpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/Hero.hpp" 2 | 3 | namespace hikari { 4 | 5 | /** 6 | * Encapsulates the "teleporting" state that the Hero can be in. This class is a 7 | * private inner class of Hero. 8 | * 9 | * @see Hero 10 | * @see Hero::MobilityState 11 | */ 12 | class Hero::TeleportingMobilityState : public Hero::MobilityState { 13 | private: 14 | float morphingLimit; 15 | float morphingCounter; 16 | public: 17 | TeleportingMobilityState(Hero & hero); 18 | virtual ~TeleportingMobilityState(); 19 | virtual void enter(); 20 | virtual void exit(); 21 | virtual StateChangeAction update(const float & dt); 22 | }; 23 | 24 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/core/game/AnimationPlaybackException.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_ANIMATIONPLAYBACKEXCEPTION 2 | #define HIKARI_CORE_GAME_ANIMATIONPLAYBACKEXCEPTION 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include 6 | #include 7 | 8 | #if (_WIN32 && _MSC_VER) 9 | #pragma warning(push) 10 | #pragma warning(disable:4275) 11 | #endif 12 | 13 | namespace hikari { 14 | 15 | class HIKARI_API AnimationPlaybackException : public std::runtime_error { 16 | public: 17 | explicit AnimationPlaybackException(const std::string& what); 18 | virtual ~AnimationPlaybackException() throw() { } 19 | }; 20 | 21 | } // hikari 22 | 23 | #if (_WIN32 && _MSC_VER) 24 | #pragma warning(pop) 25 | #endif 26 | 27 | #endif // HIKARI_CORE_GAME_ANIMATIONPLAYBACKEXCEPTION 28 | -------------------------------------------------------------------------------- /extlibs/guichan-sfml/include/guichan/sfml/sfmlimageloader.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GCN_SFMLIMAGELOADER_HPP 2 | #define GCN_SFMLIMAGELOADER_HPP 3 | 4 | #include "guichan/imageloader.hpp" 5 | #include "guichan/platform.hpp" 6 | 7 | namespace sf { 8 | class Texture; 9 | } 10 | 11 | namespace gcn 12 | { 13 | class Image; 14 | 15 | /** 16 | * SFML implementation of ImageLoader. 17 | */ 18 | class GCN_EXTENSION_DECLSPEC SFMLImageLoader : public ImageLoader 19 | { 20 | public: 21 | 22 | // Inherited from ImageLoader 23 | 24 | virtual Image* load(const std::string& filename, bool convertToDisplayFormat = true); 25 | 26 | protected: 27 | virtual sf::Texture* loadSFMLTexture(const std::string& filename); 28 | }; 29 | } 30 | 31 | #endif // end GCN_SFMLIMAGELOADER_HPP 32 | -------------------------------------------------------------------------------- /engine/include/hikari/core/util/TilesetCache.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_TILESETCACHE 2 | #define HIKARI_CORE_UTIL_TILESETCACHE 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/game/map/Tileset.hpp" 6 | #include "hikari/core/game/map/TilesetLoader.hpp" 7 | #include "hikari/core/util/ResourceCache.hpp" 8 | 9 | namespace hikari { 10 | 11 | class HIKARI_API TilesetCache : public ResourceCache { 12 | private: 13 | std::shared_ptr loader; 14 | 15 | protected: 16 | virtual TilesetCache::Resource loadResource(const std::string &fileName); 17 | 18 | public: 19 | TilesetCache(const std::shared_ptr &loader); 20 | 21 | virtual ~TilesetCache() { } 22 | }; 23 | 24 | } // hikari 25 | 26 | #endif // HIKARI_CORE_UTIL_TILESETCACHE -------------------------------------------------------------------------------- /engine/src/hikari/client/game/BaseTask.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/BaseTask.hpp" 2 | 3 | namespace hikari { 4 | BaseTask::BaseTask(int priority, SequenceType type) 5 | : Task() 6 | , sequenceType(type) 7 | , priority(priority) 8 | , completedFlag(false) 9 | { 10 | 11 | } 12 | 13 | BaseTask::~BaseTask() { 14 | 15 | } 16 | 17 | void BaseTask::markAsCompleted() { 18 | completedFlag = true; 19 | } 20 | 21 | bool BaseTask::isComplete() const { 22 | return completedFlag; 23 | } 24 | 25 | int BaseTask::getPriority() const { 26 | return priority; 27 | } 28 | 29 | Task::SequenceType BaseTask::getSequenceType() const { 30 | return sequenceType; 31 | } 32 | 33 | void BaseTask::update(float dt) { 34 | 35 | } 36 | 37 | } // hikari 38 | -------------------------------------------------------------------------------- /content/assets/scripts/effects/ModifyHealthEffect.nut: -------------------------------------------------------------------------------- 1 | class ModifyHealthEffect extends EffectBase { 2 | amount = 0; 3 | 4 | constructor(config = { amount = 0 }) { 5 | // Ensure valid configuration parameters. 6 | config = _.defaults(config, { 7 | amount = 0 8 | }); 9 | 10 | base.constructor(config); 11 | 12 | amount = config.amount; 13 | 14 | ::log("ModifyHealthEffect constructor called."); 15 | } 16 | 17 | function applyEffect() { 18 | ::log("ModifyHealthEffect::applyEffect called."); 19 | ::log("You life was modified by " + amount + "!"); 20 | ::hikari.game.refillHealth(amount); 21 | } 22 | 23 | function unapplyEffect() { 24 | ::log("ModifyHealthEffect::unapplyEffect called."); 25 | } 26 | } 27 | 28 | ::log("ModifyHealthEffect processed!"); -------------------------------------------------------------------------------- /engine/include/hikari/core/game/CollisionResolver.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_COLLISIONRESOLVER 2 | #define HIKARI_CORE_GAME_COLLISIONRESOLVER 3 | 4 | #include "hikari/core/game/Direction.hpp" 5 | 6 | namespace hikari { 7 | 8 | class CollisionInfo; 9 | 10 | /** 11 | Interface for classes that can check for and resolve 12 | object-to-world collisions. 13 | */ 14 | class CollisionResolver { 15 | public: 16 | virtual ~CollisionResolver() {} 17 | virtual void checkHorizontalEdge(const int& x, const int& yMin, const int& yMax, const Direction& directionX, CollisionInfo& collisionInfo) = 0; 18 | virtual void checkVerticalEdge(const int& y, const int& xMin, const int& xMax, const Direction& directionY, CollisionInfo& collisionInfo) = 0; 19 | }; 20 | 21 | } // hikari 22 | 23 | #endif // HIKARI_CORE_GAME_COLLISIONRESOLVER -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/EventListenerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/EventListenerDelegate.hpp" 2 | 3 | namespace hikari { 4 | 5 | // Static variable initialization 6 | long long FunctionDelegateBase::nextId = 0; 7 | 8 | FunctionDelegateBase::FunctionDelegateBase(const std::function & func) 9 | : id(nextId++) 10 | , fn(func) 11 | { 12 | 13 | } 14 | 15 | void FunctionDelegateBase::operator()(EventDataPtr eventPtr) { 16 | if(fn) { 17 | fn(eventPtr); 18 | } 19 | } 20 | 21 | bool FunctionDelegateBase::operator == (const FunctionDelegateBase &fdb) const { 22 | return id == fdb.id; 23 | } 24 | 25 | bool FunctionDelegateBase::operator != (const FunctionDelegateBase &fdb) const { 26 | return !(*this==fdb); 27 | } 28 | 29 | } // hikari -------------------------------------------------------------------------------- /engine/src/hikari/client/game/DamageTable.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/DamageTable.hpp" 2 | 3 | namespace hikari { 4 | 5 | DamageTable::DamageTable() 6 | : Service() 7 | , damageValues() 8 | // , damageBuffs() 9 | { 10 | 11 | } 12 | 13 | DamageTable::~DamageTable() { 14 | 15 | } 16 | 17 | void DamageTable::addEntry(int damageId, float ammount) { 18 | damageValues[damageId] = ammount; 19 | } 20 | 21 | bool DamageTable::hasEntryFor(int damageId) const { 22 | return damageValues.count(damageId) > 0; 23 | } 24 | 25 | float DamageTable::getDamageFor(int damageId) const { 26 | auto it = damageValues.find(damageId); 27 | 28 | if(it != std::end(damageValues)) { 29 | return it->second; 30 | } 31 | 32 | return 0.0f; 33 | } 34 | 35 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/EventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_EVENTDATA 2 | #define HIKARI_CLIENT_EVENTDATA 3 | 4 | #include 5 | 6 | namespace hikari { 7 | 8 | typedef unsigned long EventType; 9 | typedef float EventTime; 10 | 11 | // 12 | // Forward declaration to enable shared_ptr typedef 13 | // 14 | class EventData; 15 | 16 | typedef std::shared_ptr EventDataPtr; 17 | 18 | /** 19 | * Interface for all event data objects. 20 | */ 21 | class EventData { 22 | public: 23 | virtual ~EventData(); 24 | virtual const EventType & getEventType() const = 0; 25 | virtual EventTime getTimeStamp() const = 0; 26 | virtual EventDataPtr copy() const = 0; 27 | virtual const char * getName() const = 0; 28 | }; 29 | 30 | } // hikari 31 | 32 | #endif // HIKARI_CLIENT_EVENTDATA -------------------------------------------------------------------------------- /engine/include/hikari/core/util/RedirectStream.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_REDIRECTSTREAM 2 | #define HIKARI_CORE_UTIL_REDIRECTSTREAM 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include 6 | 7 | namespace hikari { 8 | 9 | /** 10 | A class to safely redirect one stream to another. When a RedirectStream 11 | goes out of scope it restores the original buffer of the stream. 12 | 13 | The source and idea for this came from: 14 | http://www.gamedev.net/topic/523200-c---freopen-vs-freopen_s/ 15 | */ 16 | class HIKARI_API RedirectStream { 17 | private: 18 | std::ios* fromStream; 19 | std::streambuf* fromBuffer; 20 | 21 | public: 22 | explicit RedirectStream(std::ios& from, std::ios& to); 23 | ~RedirectStream(); 24 | }; 25 | 26 | } // hikari 27 | 28 | #endif // HIKARI_CORE_UTIL_REDIRECTSTREAM -------------------------------------------------------------------------------- /content/assets/scripts/effects/ModifyWeaponEnergyEffect.nut: -------------------------------------------------------------------------------- 1 | class ModifyWeaponEnergyEffect extends EffectBase { 2 | amount = 0; 3 | 4 | constructor(config = { amount = 0 }) { 5 | // Ensure valid configuration parameters. 6 | config = _.defaults(config, { 7 | amount = 0 8 | }); 9 | 10 | base.constructor(config); 11 | 12 | amount = config.amount; 13 | 14 | ::log("ModifyWeaponEnergyEffect constructor called."); 15 | } 16 | 17 | function applyEffect() { 18 | ::log("ModifyWeaponEnergyEffect::applyEffect called."); 19 | ::log("You life was modified by " + amount + "!"); 20 | ::hikari.game.refillWeapon(amount); 21 | } 22 | 23 | function unapplyEffect() { 24 | ::log("ModifyWeaponEnergyEffect::unapplyEffect called."); 25 | } 26 | } 27 | 28 | ::log("ModifyWeaponEnergyEffect processed!"); -------------------------------------------------------------------------------- /engine/include/hikari/core/game/FadeStateTransition.hpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/game/StateTransition.hpp" 2 | #include "hikari/client/game/FadeColorTask.hpp" 3 | 4 | #include 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class FadeStateTransition : public StateTransition { 10 | public: 11 | enum FadeDirection { 12 | FADE_OUT = 0, 13 | FADE_IN = 1 14 | }; 15 | 16 | private: 17 | FadeDirection direction; 18 | sf::RectangleShape overlay; 19 | FadeColorTask fadeTask; 20 | 21 | public: 22 | FadeStateTransition(FadeDirection direction, sf::Color color, float duration); 23 | virtual ~FadeStateTransition(); 24 | 25 | virtual void render(sf::RenderTarget &target); 26 | virtual void update(float dt); 27 | }; 28 | 29 | } // hikari 30 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/DoorEventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_DOOREVENTDATA 2 | #define HIKARI_CLIENT_DOOREVENTDATA 3 | 4 | #include "hikari/client/game/events/BaseEventData.hpp" 5 | 6 | #include 7 | 8 | namespace hikari { 9 | 10 | class Door; 11 | 12 | class DoorEventData : public BaseEventData { 13 | public: 14 | static const EventType Type; 15 | 16 | private: 17 | std::weak_ptr door; 18 | 19 | public: 20 | explicit DoorEventData(const std::weak_ptr & door); 21 | virtual ~DoorEventData(); 22 | 23 | const std::weak_ptr & getDoor() const; 24 | 25 | virtual const EventType & getEventType() const; 26 | 27 | virtual EventDataPtr copy() const; 28 | virtual const char * getName() const; 29 | }; 30 | 31 | } // hikari 32 | 33 | #endif // HIKARI_CLIENT_DOOREVENTDATA -------------------------------------------------------------------------------- /engine/include/hikari/core/game/SpriteAnimator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_SPRITEANIMATOR 2 | #define HIKARI_CORE_GAME_SPRITEANIMATOR 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/game/Animator.hpp" 6 | #include 7 | 8 | namespace sf { 9 | class Sprite; 10 | } 11 | 12 | namespace hikari { 13 | 14 | class HIKARI_API SpriteAnimator : public Animator { 15 | private: 16 | bool invertXOffset; 17 | bool invertYOffset; 18 | sf::Sprite &sprite; 19 | sf::IntRect sourceRectangle; 20 | 21 | public: 22 | SpriteAnimator(sf::Sprite &sprite); 23 | virtual ~SpriteAnimator(); 24 | void setInvertXOffset(const bool flip); 25 | void setInvertYOffset(const bool flip); 26 | virtual void update(float delta); 27 | }; 28 | 29 | } // hikari 30 | 31 | #endif // HIKARI_CORE_GAME_SPRITEANIMATOR -------------------------------------------------------------------------------- /engine/include/hikari/core/game/TileAnimator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_TILEANIMATOR 2 | #define HIKARI_CORE_GAME_TILEANIMATOR 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/game/Animator.hpp" 6 | #include 7 | #include 8 | 9 | namespace hikari { 10 | 11 | class HIKARI_API TileAnimator : public Animator { 12 | private: 13 | int tileIndex; 14 | std::vector &tiles; 15 | 16 | public: 17 | TileAnimator(std::vector &tiles, unsigned int tileIndex); 18 | TileAnimator& operator=(const TileAnimator & other); 19 | const int& getUpdatedTileIndex() const; 20 | virtual ~TileAnimator() { } 21 | virtual void update(float delta); 22 | void update(float delta, sf::IntRect &tileRect); 23 | }; 24 | 25 | } // hikari 26 | 27 | #endif // HIKARI_CORE_GAME_TILEANIMATOR -------------------------------------------------------------------------------- /extlibs/squirrel/sqstdlib/sqstdstream.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_STREAM_H_ 3 | #define _SQSTD_STREAM_H_ 4 | 5 | SQInteger _stream_readblob(HSQUIRRELVM v); 6 | SQInteger _stream_readline(HSQUIRRELVM v); 7 | SQInteger _stream_readn(HSQUIRRELVM v); 8 | SQInteger _stream_writeblob(HSQUIRRELVM v); 9 | SQInteger _stream_writen(HSQUIRRELVM v); 10 | SQInteger _stream_seek(HSQUIRRELVM v); 11 | SQInteger _stream_tell(HSQUIRRELVM v); 12 | SQInteger _stream_len(HSQUIRRELVM v); 13 | SQInteger _stream_eos(HSQUIRRELVM v); 14 | SQInteger _stream_flush(HSQUIRRELVM v); 15 | 16 | #define _DECL_STREAM_FUNC(name,nparams,typecheck) {_SC(#name),_stream_##name,nparams,typecheck} 17 | SQRESULT declare_stream(HSQUIRRELVM v,const SQChar* name,SQUserPointer typetag,const SQChar* reg_name,const SQRegFunction *methods,const SQRegFunction *globals); 18 | #endif /*_SQSTD_STREAM_H_*/ 19 | -------------------------------------------------------------------------------- /engine/src/hikari/core/game/map/Force.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/game/map/Force.hpp" 2 | 3 | namespace hikari { 4 | 5 | Force::Force(const BoundingBox & bounds, const Vector2 & velocity) 6 | : bounds(bounds) 7 | , velocity(velocity) 8 | , activeFlag(true) 9 | { 10 | 11 | } 12 | 13 | void Force::setVelocity(const Vector2 & vel) { 14 | velocity = vel; 15 | } 16 | 17 | const BoundingBox & Force::getBounds() const { 18 | return bounds; 19 | } 20 | 21 | const Vector2 & Force::getVelocity() const { 22 | return velocity; 23 | } 24 | 25 | bool Force::isActive() const { 26 | return activeFlag; 27 | } 28 | 29 | void Force::enable() { 30 | activeFlag = true; 31 | } 32 | 33 | void Force::disable() { 34 | activeFlag = false; 35 | } 36 | 37 | } // hikari 38 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/WeaponAction.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_WEAPONACTION 2 | #define HIKARI_CLIENT_GAME_WEAPONACTION 3 | 4 | #include 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class GameWorld; 10 | class GameObject; 11 | class Weapon; 12 | class WeaponFireEventData; 13 | 14 | /** 15 | * A WeaponAction is something that a Weapon uses to perform its action. 16 | */ 17 | class WeaponAction { 18 | public: 19 | WeaponAction(); 20 | virtual ~WeaponAction(); 21 | 22 | /** 23 | * Applied the effects of the WeaponAction to a GameWorld. 24 | * 25 | * @param world the GameWorld instance where the actions take effect 26 | */ 27 | virtual std::weak_ptr apply(GameWorld & world, const Weapon & weapon, WeaponFireEventData & eventData) const; 28 | }; 29 | 30 | } // hikari 31 | 32 | #endif // HIKARI_CLIENT_GAME_WEAPONACTION -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/EntityDamageEventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_ENTITYDAMAGEEVENTDATA 2 | #define HIKARI_CLIENT_ENTITYDAMAGEEVENTDATA 3 | 4 | #include "hikari/client/game/events/BaseEventData.hpp" 5 | 6 | namespace hikari { 7 | 8 | class EntityDamageEventData : public BaseEventData { 9 | public: 10 | static const EventType Type; 11 | 12 | private: 13 | int entityId; 14 | float amount; 15 | 16 | public: 17 | EntityDamageEventData(int entityId, float amount); 18 | virtual ~EntityDamageEventData(); 19 | 20 | int getEntityId() const; 21 | float getAmount() const; 22 | 23 | virtual const EventType & getEventType() const; 24 | 25 | virtual EventDataPtr copy() const; 26 | virtual const char * getName() const; 27 | }; 28 | 29 | } // hikari 30 | 31 | #endif // HIKARI_CLIENT_ENTITYDAMAGEEVENTDATA -------------------------------------------------------------------------------- /engine/include/hikari/client/gui/Panel.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GUI_PANEL 2 | #define HIKARI_CLIENT_GUI_PANEL 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace hikari { 9 | namespace gui { 10 | 11 | class Panel : public gcn::Container { 12 | private: 13 | gcn::Color innerBorderColor; 14 | gcn::Color shadowColor; 15 | 16 | bool drawShadow; 17 | 18 | void drawInnerBorder(gcn::Graphics* graphics) const; 19 | 20 | public: 21 | Panel(); 22 | virtual ~Panel(); 23 | 24 | void setInnerBorderColor(const gcn::Color & innerBorderColor); 25 | const gcn::Color & getInnerBorderColor() const; 26 | 27 | //Inherited from Widget 28 | virtual void draw(gcn::Graphics* graphics); 29 | }; 30 | 31 | } // hikari::gui 32 | } // hikari 33 | 34 | #endif // HIKARI_CLIENT_GUI_PANEL -------------------------------------------------------------------------------- /engine/include/hikari/client/scripting/SquirrelUtils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_SCRIPTING_SQUIRRELUTILS 2 | #define HIKARI_CLIENT_SCRIPTING_SQUIRRELUTILS 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | // Forward declaration of Json classes 11 | namespace Json { 12 | class Value; 13 | } 14 | 15 | namespace hikari { 16 | namespace SquirrelUtils { 17 | 18 | /** 19 | * Converts a JSON value (an array or object) to a Squirre array or table. 20 | * If conversion cannot take place or encounters an error, an exception is 21 | * thrown. 22 | * 23 | * @param json the JSON value to convert 24 | * @return the Squirrel equivalent of the JSON object 25 | */ 26 | Sqrat::Object jsonToSquirrel(HSQUIRRELVM vm, const Json::Value & json); 27 | } 28 | } // hikari 29 | 30 | #endif // HIKARI_CLIENT_SCRIPTING_SQUIRRELUTILS 31 | -------------------------------------------------------------------------------- /engine/include/hikari/core/game/CollisionInfo.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_COLLISIONINFO 2 | #define HIKARI_CORE_GAME_COLLISIONINFO 3 | 4 | #include "hikari/core/game/Direction.hpp" 5 | 6 | namespace hikari { 7 | 8 | class CollisionInfo { 9 | public: 10 | bool treatPlatformAsGround; 11 | bool isCollisionX; 12 | bool isCollisionY; 13 | int worldX; 14 | int worldY; 15 | Direction directionX; 16 | Direction directionY; 17 | int tileX; 18 | int tileY; 19 | int correctedX; 20 | int correctedY; 21 | int tileType; 22 | float inheritedVelocityX; 23 | float inheritedVelocityY; 24 | 25 | CollisionInfo(); 26 | 27 | /** 28 | Restores all properties to their default values. 29 | */ 30 | void clear(); 31 | }; 32 | 33 | } 34 | 35 | #endif // HIKARI_CORE_GAME_COLLISIONINFO -------------------------------------------------------------------------------- /engine/src/hikari/client/game/objects/effects/NothingEffect.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "hikari/client/game/objects/effects/NothingEffect.hpp" 3 | #include "hikari/core/util/Log.hpp" 4 | 5 | namespace hikari { 6 | 7 | NothingEffect::NothingEffect() { 8 | 9 | } 10 | 11 | NothingEffect::NothingEffect(const NothingEffect &proto) { 12 | HIKARI_LOG(debug) << "NothingEffect copy constructor"; 13 | } 14 | 15 | std::shared_ptr NothingEffect::clone() const { 16 | return std::make_shared(*this); 17 | } 18 | 19 | NothingEffect::~NothingEffect() { 20 | 21 | } 22 | 23 | void NothingEffect::apply() { 24 | // Nothing to do here! 25 | HIKARI_LOG(info) << "NothingEffect::apply()"; 26 | } 27 | 28 | void NothingEffect::unapply() { 29 | // Nothing to do here! 30 | HIKARI_LOG(info) << "NothingEffect::unapply()"; 31 | } 32 | 33 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/core/game/map/Force.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_MAP_FORCE 2 | #define HIKARI_CORE_GAME_MAP_FORCE 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/geom/BoundingBox.hpp" 6 | #include "hikari/core/math/Vector2.hpp" 7 | 8 | namespace hikari { 9 | 10 | class HIKARI_API Force { 11 | private: 12 | BoundingBox bounds; 13 | Vector2 velocity; 14 | bool activeFlag; 15 | 16 | protected: 17 | void setVelocity(const Vector2 & vel); 18 | 19 | public: 20 | Force(const BoundingBox & bounds, const Vector2 & velocity); 21 | 22 | const BoundingBox & getBounds() const; 23 | const Vector2 & getVelocity() const; 24 | bool isActive() const; 25 | 26 | void enable(); 27 | void disable(); 28 | }; 29 | 30 | } // hikari 31 | 32 | #endif // HIKARI_CORE_GAME_MAP_FORCE 33 | -------------------------------------------------------------------------------- /extlibs/sqrat/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Brandon Jones 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/EntityDeathType.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_ENTITYDEATHTYPE 2 | #define HIKARI_CLIENT_GAME_OBJECTS_ENTITYDEATHTYPE 3 | 4 | namespace hikari { 5 | 6 | /** 7 | * EntityDeathType is an enum of values describing the "type" of death an 8 | * Entity should experience. Basically, the kind of explosion that should 9 | * appear at death. 10 | */ 11 | namespace EntityDeathType { 12 | enum Type { 13 | Nothing, /// Nothing should appear 14 | Hurt, /// The "hurt" marks (like when Rock gets damaged) 15 | Small, /// A small radial explosion should appear 16 | Large, /// A larger spiralling explosion should appear 17 | Hero /// 16 small radial explosions (Rock or Robot Master) 18 | }; 19 | } 20 | 21 | } // hikari 22 | 23 | #endif // HIKARI_CLIENT_GAME_OBJECTS_ENTITYDEATHTYPE -------------------------------------------------------------------------------- /extlibs/jsoncpp/include/json/forwards.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_FORWARDS_H_INCLUDED 2 | # define JSON_FORWARDS_H_INCLUDED 3 | 4 | # include "config.h" 5 | 6 | namespace Json { 7 | 8 | // writer.h 9 | class FastWriter; 10 | class StyledWriter; 11 | 12 | // reader.h 13 | class Reader; 14 | 15 | // features.h 16 | class Features; 17 | 18 | // value.h 19 | typedef int Int; 20 | typedef unsigned int UInt; 21 | class StaticString; 22 | class Path; 23 | class PathArgument; 24 | class Value; 25 | class ValueIteratorBase; 26 | class ValueIterator; 27 | class ValueConstIterator; 28 | #ifdef JSON_VALUE_USE_INTERNAL_MAP 29 | class ValueAllocator; 30 | class ValueMapAllocator; 31 | class ValueInternalLink; 32 | class ValueInternalArray; 33 | class ValueInternalMap; 34 | #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP 35 | 36 | } // namespace Json 37 | 38 | 39 | #endif // JSON_FORWARDS_H_INCLUDED 40 | -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/TransitionCollisionEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/TransitionCollisionEventData.hpp" 2 | 3 | namespace hikari { 4 | 5 | const EventType TransitionCollisionEventData::Type = 0x94ae3da4; 6 | 7 | TransitionCollisionEventData::TransitionCollisionEventData() 8 | : BaseEventData(0.0f) 9 | { 10 | 11 | } 12 | 13 | TransitionCollisionEventData::~TransitionCollisionEventData() { 14 | // Do nothing! 15 | } 16 | 17 | const EventType & TransitionCollisionEventData::getEventType() const { 18 | return TransitionCollisionEventData::Type; 19 | } 20 | 21 | EventDataPtr TransitionCollisionEventData::copy() const { 22 | return EventDataPtr(new TransitionCollisionEventData()); 23 | } 24 | 25 | const char * TransitionCollisionEventData::getName() const { 26 | return "TransitionCollisionEventData"; 27 | } 28 | 29 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/core/util/AnimationSetCache.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_ANIMATIONSETCACHE 2 | #define HIKARI_CORE_UTIL_ANIMATIONSETCACHE 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/util/ResourceCache.hpp" 6 | #include "hikari/core/util/Service.hpp" 7 | 8 | #include "hikari/core/game/AnimationSet.hpp" 9 | 10 | #include 11 | 12 | namespace hikari { 13 | 14 | class AnimationLoader; 15 | 16 | class HIKARI_API AnimationSetCache : public Service, public ResourceCache { 17 | private: 18 | std::shared_ptr loader; 19 | 20 | protected: 21 | virtual AnimationSetCache::Resource loadResource(const std::string &fileName); 22 | 23 | public: 24 | AnimationSetCache(const std::shared_ptr & loader); 25 | 26 | virtual ~AnimationSetCache() { } 27 | }; 28 | 29 | } // hikari 30 | 31 | #endif // HIKARI_CORE_UTIL_ANIMATIONSETCACHE -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/GameQuitEventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAMEQUITEVENTDATA 2 | #define HIKARI_CLIENT_GAMEQUITEVENTDATA 3 | 4 | #include "hikari/client/game/events/BaseEventData.hpp" 5 | 6 | namespace hikari { 7 | 8 | class GameQuitEventData : public BaseEventData { 9 | public: 10 | static const EventType Type; 11 | 12 | enum QuitType { 13 | PROMPT_USER, 14 | QUIT_NOW 15 | }; 16 | 17 | private: 18 | QuitType quitType; 19 | 20 | public: 21 | explicit GameQuitEventData(QuitType quitType = PROMPT_USER); 22 | virtual ~GameQuitEventData(); 23 | 24 | QuitType getQuitType() const; 25 | 26 | virtual const EventType & getEventType() const; 27 | 28 | virtual EventDataPtr copy() const; 29 | virtual const char * getName() const; 30 | }; 31 | 32 | } // hikari 33 | 34 | #endif // HIKARI_CLIENT_GAMEQUITEVENTDATA -------------------------------------------------------------------------------- /engine/include/hikari/client/gui/HikariImageLoader.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GUI_HIKARIIMAGELOADER 2 | #define HIKARI_CLIENT_GUI_HIKARIIMAGELOADER 3 | 4 | #include 5 | #include "guichan/imageloader.hpp" 6 | #include "hikari/core/util/ImageCache.hpp" 7 | 8 | namespace gcn { 9 | class Image; 10 | } 11 | 12 | namespace hikari { 13 | namespace gui { 14 | 15 | class HikariImageLoader : public gcn::ImageLoader { 16 | private: 17 | std::weak_ptr imageCache; 18 | 19 | public: 20 | explicit HikariImageLoader(const std::weak_ptr & imageCache); 21 | virtual ~HikariImageLoader(); 22 | virtual gcn::Image* load(const std::string& filename, bool convertToDisplayFormat = true); 23 | 24 | protected: 25 | ImageCache::Resource loadTextureFromCache(const std::string& filename); 26 | }; 27 | 28 | } // hikari::gui 29 | } // hikari 30 | 31 | #endif // HIKARI_CLIENT_GUI_HIKARIIMAGELOADER -------------------------------------------------------------------------------- /engine/src/hikari/core/game/Direction.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/game/Direction.hpp" 2 | 3 | namespace hikari { 4 | 5 | const Direction Directions::None = Direction(-1); 6 | const Direction Directions::Up = Direction(0); 7 | const Direction Directions::Right = Direction(1); 8 | const Direction Directions::Down = Direction(2); 9 | const Direction Directions::Left = Direction(3); 10 | 11 | Directions::Directions() { 12 | 13 | } 14 | 15 | Direction Directions::opposite(const Direction& dir) { 16 | if(dir == Directions::Up) { 17 | return Directions::Down; 18 | } else if(dir == Directions::Right) { 19 | return Directions::Left; 20 | } else if(dir == Directions::Down) { 21 | return Directions::Up; 22 | } else if(dir == Directions::Left) { 23 | return Directions::Right; 24 | } 25 | 26 | return Directions::None; 27 | } 28 | 29 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/Faction.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_FACTION 2 | #define HIKARI_CLIENT_GAME_OBJECTS_FACTION 3 | 4 | namespace hikari { 5 | typedef int Faction; 6 | 7 | class Factions { 8 | public: 9 | static const Faction World; 10 | static const Faction Hero; 11 | static const Faction Enemy; 12 | 13 | private: 14 | Factions(); 15 | }; 16 | 17 | // namespace Faction { 18 | 19 | // * 20 | // * An enumeration of different factions to be used by game objects. Factions 21 | // * allow objects to be grouped together in such a way that it makes it 22 | // * easier to determine what happens when the objects interact with each other. 23 | 24 | // enum Type { 25 | // World = 0, 26 | // Hero = 1, 27 | // Enemy = 2 28 | // }; 29 | 30 | // } // hikari::Faction 31 | } // hikari 32 | 33 | #endif // HIKARI_CLIENT_GAME_OBJECTS_FACTION 34 | -------------------------------------------------------------------------------- /engine/src/hikari/client/gui/InputHelper.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/gui/InputHelper.hpp" 2 | 3 | namespace hikari { 4 | namespace gui { 5 | 6 | std::unordered_map InputHelper::keyToButtonMapping = std::unordered_map(); 7 | 8 | InputHelper::InputHelper() { 9 | 10 | } 11 | 12 | InputHelper::InputHelper(const InputHelper & proto) { 13 | 14 | } 15 | 16 | Input::Button InputHelper::getMappedButtonForKey(const gcn::Key & key) { 17 | auto mappedButton = keyToButtonMapping.find(key.getValue()); 18 | 19 | if(mappedButton != keyToButtonMapping.end()) { 20 | return mappedButton->second; 21 | } 22 | 23 | return Input::BUTTON_NONE; 24 | } 25 | 26 | void InputHelper::setMappedButtonForKey(const gcn::Key & key, Input::Button button) { 27 | keyToButtonMapping[key.getValue()] = button; 28 | } 29 | 30 | } // hikari::gui 31 | } // hikari 32 | -------------------------------------------------------------------------------- /content/assets/shaders/palette.frag: -------------------------------------------------------------------------------- 1 | uniform sampler2D texture; 2 | uniform sampler2D colorTableTexture; 3 | uniform float colorTableWidth; 4 | uniform float colorTableHeight; 5 | uniform float paletteIndex; 6 | 7 | void main() 8 | { 9 | vec4 sourcePixel = texture2D(texture, gl_TexCoord[0].xy); 10 | 11 | // Preserve transparent source pixels 12 | if(sourcePixel.a == 0.0) { 13 | discard; 14 | } 15 | 16 | // Apply color mapping to opaque pixels. 17 | // 18 | // The source pixel RGB values are are normalized between 0.0 and 1.0, 19 | // so in order to get the correct "index" you must multiply the RGB value 20 | // by 256.0, and then scale it back down to a value normalized by the width 21 | // of the color table. 22 | 23 | vec2 colorIndex = vec2((sourcePixel.r * 256.0) / colorTableWidth, paletteIndex / colorTableHeight); 24 | vec4 mappedPixel = texture2D(colorTableTexture, colorIndex); 25 | gl_FragColor = mappedPixel; 26 | } 27 | -------------------------------------------------------------------------------- /content/assets/animations/cursor.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Stage Select Cursor", 3 | "image": "assets/images/cursor-stage-select.png", 4 | "animations": { 5 | "default": { 6 | "repeat": true, 7 | "keyframe": 0, 8 | "syncGroup": 0, 9 | "frames": [ 10 | { 11 | "x" : 0, 12 | "y" : 0, 13 | "width" : 48, 14 | "height" : 48, 15 | "hotspotX" : 0, 16 | "hotspotY" : 0, 17 | "length" : 0.1333 18 | }, 19 | { 20 | "x" : 48, 21 | "y" : 0, 22 | "width" : 48, 23 | "height" : 48, 24 | "hotspotX" : 0, 25 | "hotspotY" : 0, 26 | "length" : 0.1333 27 | } 28 | ] 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /content/assets/animations/heroes-dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "image": "", 3 | "animations": { 4 | "rockman": { 5 | "idle": { 6 | "repeat": true, 7 | "keyframe": 0, 8 | "frames": [ 9 | { "x" : 0, "y" : 0, "width" : 22, "height" : 24, "hotspotX" : 19, "hotspotY" : 24, "length" : 5.0 } 10 | ] 11 | }, 12 | "running": { 13 | "repeat": true, 14 | "keyframe": 1, 15 | "frames": [ 16 | { "x" : 22, "y" : 0, "width" : 22, "height" : 24, "hotspotX" : 19, "hotspotY" : 24, "length" : 0.1 }, 17 | { "x" : 44, "y" : 0, "width" : 30, "height" : 24, "hotspotX" : 23, "hotspotY" : 24, "length" : 0.1 }, 18 | { "x" : 74, "y" : 0, "width" : 20, "height" : 24, "hotspotX" : 18, "hotspotY" : 24, "length" : 0.1333 }, 19 | { "x" : 94, "y" : 0, "width" : 22, "height" : 24, "hotspotX" : 19, "hotspotY" : 24, "length" : 0.1333 }, 20 | { "x" : 74, "y" : 0, "width" : 20, "height" : 24, "hotspotX" : 18, "hotspotY" : 24, "length" : 0.1333 } 21 | ] 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /content/assets/shaders/fade.frag: -------------------------------------------------------------------------------- 1 | 2 | uniform sampler2D texture; 3 | uniform float fadePercent; 4 | 5 | const vec4 level0 = vec4(0x5F, 0x5F, 0x5F, 0xFF) / 255.0; 6 | const vec4 level1 = vec4(0x2F, 0x2F, 0x2F, 0xFF) / 255.0; 7 | const vec4 level2 = vec4(0x1F, 0x1F, 0x1F, 0xFF) / 255.0; 8 | const vec4 level3 = vec4(0x0F, 0x0F, 0x0F, 0xFF) / 255.0; 9 | 10 | void main() 11 | { 12 | vec4 sourcePixel = texture2D(texture, gl_TexCoord[0].xy); 13 | 14 | // Do tinting/fading based on elapsed time.. 15 | vec4 tintedPixel = sourcePixel; 16 | 17 | if(fadePercent <= 0.0) { 18 | tintedPixel = sourcePixel; 19 | } else if(fadePercent < 25.0) { 20 | tintedPixel = sourcePixel * level0; 21 | } else if(fadePercent < 50.0) { 22 | tintedPixel = sourcePixel * level1; 23 | } else if(fadePercent < 75.0) { 24 | tintedPixel = sourcePixel * level2; 25 | } else { 26 | tintedPixel = sourcePixel * level3; 27 | } 28 | 29 | gl_FragColor = tintedPixel; 30 | } 31 | -------------------------------------------------------------------------------- /engine/include/hikari/client/gui/MenuItem.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GUI_MENUITEM 2 | #define HIKARI_CLIENT_GUI_MENUITEM 3 | 4 | #include 5 | #include 6 | 7 | namespace hikari { 8 | namespace gui { 9 | 10 | class MenuItem : public gcn::Widget { 11 | private: 12 | std::string name; 13 | bool selected; 14 | 15 | protected: 16 | virtual void adjustSize(); 17 | 18 | public: 19 | MenuItem(); 20 | explicit MenuItem(const std::string & name); 21 | virtual ~MenuItem(); 22 | 23 | const std::string & getName() const; 24 | void setName(const std::string & name); 25 | 26 | bool isSelected() const; 27 | void select(); 28 | void deselect(); 29 | 30 | // Inherited from Widget 31 | virtual void draw(gcn::Graphics* graphics); 32 | gcn::Rectangle getChildrenArea(); 33 | }; 34 | 35 | } // hikari::gui 36 | } // hikari 37 | 38 | #endif // HIKARI_CLIENT_GUI_MENUITEM -------------------------------------------------------------------------------- /extlibs/gme-nes/blargg_config.h: -------------------------------------------------------------------------------- 1 | // Library configuration. Modify this file as necessary. 2 | 3 | #ifndef BLARGG_CONFIG_H 4 | #define BLARGG_CONFIG_H 5 | 6 | // Uncomment to use zlib for transparent decompression of gzipped files 7 | //#define HAVE_ZLIB_H 8 | 9 | // Uncomment and edit list to support only the listed game music types, 10 | // so that the others don't get linked in at all. 11 | 12 | #define GME_TYPE_LIST gme_nsf_type, gme_nsfe_type 13 | 14 | // Uncomment to enable platform-specific optimizations 15 | //#define BLARGG_NONPORTABLE 1 16 | 17 | // Uncomment to use faster, lower quality sound synthesis 18 | //#define BLIP_BUFFER_FAST 1 19 | 20 | // Uncomment if automatic byte-order determination doesn't work 21 | //#define BLARGG_BIG_ENDIAN 1 22 | 23 | // Uncomment if you get errors in the bool section of blargg_common.h 24 | //#define BLARGG_COMPILER_HAS_BOOL 1 25 | 26 | // Use standard config.h if present 27 | #ifdef HAVE_CONFIG_H 28 | #include "config.h" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/DoorEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/DoorEventData.hpp" 2 | #include "hikari/core/util/HashedString.hpp" 3 | 4 | namespace hikari { 5 | 6 | const EventType DoorEventData::Type = HashedString("DoorEventData").getHash(); 7 | 8 | DoorEventData::DoorEventData(const std::weak_ptr & door) 9 | : BaseEventData(0.0f) 10 | , door(door) 11 | { 12 | 13 | } 14 | 15 | DoorEventData::~DoorEventData() { 16 | // Do nothing! 17 | } 18 | 19 | const std::weak_ptr & DoorEventData::getDoor() const { 20 | return door; 21 | } 22 | 23 | const EventType & DoorEventData::getEventType() const { 24 | return DoorEventData::Type; 25 | } 26 | 27 | EventDataPtr DoorEventData::copy() const { 28 | return EventDataPtr(new DoorEventData(getDoor())); 29 | } 30 | 31 | const char * DoorEventData::getName() const { 32 | return "DoorEventData"; 33 | } 34 | 35 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/core/util/HashedString.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_HASHEDSTRING 2 | #define HIKARI_CORE_UTIL_HASHEDSTRING 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include 6 | #include 7 | 8 | namespace hikari { 9 | 10 | class HashedString; 11 | 12 | std::ostream& operator<<(std::ostream& message, const HashedString& string); 13 | 14 | class HIKARI_API HashedString { 15 | private: 16 | HashedString(); 17 | std::size_t hash; 18 | std::string string; 19 | 20 | public: 21 | explicit HashedString(const std::string& string); 22 | ~HashedString(); 23 | 24 | bool operator<(const HashedString& other) const; 25 | bool operator>(const HashedString& other) const; 26 | bool operator==(const HashedString& other) const; 27 | bool operator!=(const HashedString& other) const; 28 | const std::size_t getHash() const; 29 | const std::string& getString() const; 30 | }; 31 | } 32 | 33 | #endif // HIKARI_CORE_UTIL_HASHEDSTRING 34 | -------------------------------------------------------------------------------- /extlibs/squirrel/squirrel/sqstring.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTRING_H_ 3 | #define _SQSTRING_H_ 4 | 5 | inline SQHash _hashstr (const SQChar *s, size_t l) 6 | { 7 | SQHash h = (SQHash)l; /* seed */ 8 | size_t step = (l>>5)|1; /* if string is too long, don't hash all its chars */ 9 | for (; l>=step; l-=step) 10 | h = h ^ ((h<<5)+(h>>2)+(unsigned short)*(s++)); 11 | return h; 12 | } 13 | 14 | struct SQString : public SQRefCounted 15 | { 16 | SQString(){} 17 | ~SQString(){} 18 | public: 19 | static SQString *Create(SQSharedState *ss, const SQChar *, SQInteger len = -1 ); 20 | SQInteger Next(const SQObjectPtr &refpos, SQObjectPtr &outkey, SQObjectPtr &outval); 21 | void Release(); 22 | SQSharedState *_sharedstate; 23 | SQString *_next; //chain for the string table 24 | SQInteger _len; 25 | SQHash _hash; 26 | SQChar _val[1]; 27 | }; 28 | 29 | 30 | 31 | #endif //_SQSTRING_H_ 32 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/EntityStateChangeEventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_ENTITYSTATECHANGEEVENTDATA 2 | #define HIKARI_CLIENT_ENTITYSTATECHANGEEVENTDATA 3 | 4 | #include "hikari/client/game/events/BaseEventData.hpp" 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class EntityStateChangeEventData : public BaseEventData { 10 | public: 11 | static const EventType Type; 12 | 13 | private: 14 | int entityId; 15 | std::string stateName; 16 | 17 | public: 18 | explicit EntityStateChangeEventData(int entityId, const std::string & stateName); 19 | virtual ~EntityStateChangeEventData(); 20 | 21 | int getEntityId() const; 22 | const std::string & getStateName() const; 23 | 24 | virtual const EventType & getEventType() const; 25 | 26 | virtual EventDataPtr copy() const; 27 | virtual const char * getName() const; 28 | }; 29 | 30 | } // hikari 31 | 32 | #endif // HIKARI_CLIENT_ENTITYSTATECHANGEEVENTDATA -------------------------------------------------------------------------------- /engine/include/hikari/client/game/SpawnProjectileWeaponAction.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_SPAWNPROJECTILEWEAPONACTION 2 | #define HIKARI_CLIENT_GAME_SPAWNPROJECTILEWEAPONACTION 3 | 4 | #include "hikari/client/game/WeaponAction.hpp" 5 | 6 | #include 7 | #include 8 | 9 | namespace hikari { 10 | 11 | class Motion; 12 | 13 | /** 14 | * A WeaponAction is something that a Weapon uses to perform its action. 15 | */ 16 | class SpawnProjectileWeaponAction : public WeaponAction { 17 | private: 18 | std::string projectileType; 19 | std::shared_ptr motion; 20 | 21 | public: 22 | SpawnProjectileWeaponAction(const std::string & projectileType, const std::shared_ptr & motion = std::shared_ptr(nullptr)); 23 | virtual ~SpawnProjectileWeaponAction(); 24 | virtual std::weak_ptr apply(GameWorld & world, const Weapon & weapon, WeaponFireEventData & eventData) const; 25 | }; 26 | 27 | } // hikari 28 | 29 | #endif // HIKARI_CLIENT_GAME_SPAWNPROJECTILEWEAPONACTION -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/controllers/HeroActionController.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_CONTROLLERS_HEROACTIONCONTROLLER 2 | #define HIKARI_CLIENT_GAME_OBJECTS_CONTROLLERS_HEROACTIONCONTROLLER 3 | 4 | namespace hikari { 5 | 6 | class HeroActionController { 7 | public: 8 | virtual ~HeroActionController() { } 9 | 10 | virtual bool shouldMoveUp() const = 0; 11 | virtual bool shouldMoveRight() const = 0; 12 | virtual bool shouldMoveDown() const = 0; 13 | virtual bool shouldMoveLeft() const = 0; 14 | virtual bool shouldJump() const = 0; 15 | virtual bool shouldSuperJump() const = 0; 16 | virtual bool shouldStopJumping() const = 0; 17 | virtual bool shouldShootWeapon() const = 0; 18 | virtual bool shouldChargeWeapon() const = 0; 19 | virtual bool shouldSlide() const = 0; 20 | virtual bool shouldStopSliding() const = 0; 21 | }; 22 | 23 | } // hikari 24 | 25 | #endif // HIKARI_CLIENT_GAME_OBJECTS_CONTROLLERS_HEROACTIONCONTROLLER 26 | -------------------------------------------------------------------------------- /engine/include/hikari/core/util/PhysFSUtils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_PHYSFSUTILS 2 | #define HIKARI_CORE_UTIL_PHYSFSUTILS 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include 6 | #include 7 | 8 | namespace sf { 9 | class Texture; 10 | } 11 | 12 | namespace hikari { 13 | 14 | class HIKARI_API PhysFSUtils { 15 | public: 16 | /** 17 | * Loads an SFML image using PhysFS. 18 | * @param fileName The PhysFS-style file path or name of the image to load. 19 | * @param image The SFML Image to load the data in to. 20 | */ 21 | static bool loadImage(const std::string &fileName, sf::Texture &texture); 22 | 23 | static Json::Value loadJson(const std::string &fileName); 24 | 25 | /** 26 | * Opens a file and reads its contents into a string, returning the string. 27 | */ 28 | static const std::string readFileAsString(const std::string &fileName); 29 | }; 30 | 31 | } // hikari 32 | 33 | #endif // HIKARI_CORE_UTIL_PHYSFSUTILS -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/GameQuitEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/GameQuitEventData.hpp" 2 | #include "hikari/core/util/HashedString.hpp" 3 | 4 | namespace hikari { 5 | 6 | const EventType GameQuitEventData::Type = HashedString("GameQuitEventData").getHash(); 7 | 8 | GameQuitEventData::GameQuitEventData(QuitType quitType) 9 | : BaseEventData(0.0f) 10 | , quitType(quitType) 11 | { 12 | 13 | } 14 | 15 | GameQuitEventData::QuitType GameQuitEventData::getQuitType() const { 16 | return quitType; 17 | } 18 | 19 | GameQuitEventData::~GameQuitEventData() { 20 | // Do nothing! 21 | } 22 | 23 | const EventType & GameQuitEventData::getEventType() const { 24 | return GameQuitEventData::Type; 25 | } 26 | 27 | EventDataPtr GameQuitEventData::copy() const { 28 | return EventDataPtr(new GameQuitEventData(getQuitType())); 29 | } 30 | 31 | const char * GameQuitEventData::getName() const { 32 | return "GameQuitEventData"; 33 | } 34 | 35 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/core/game/AnimationFrame.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_ANIMATIONFRAME 2 | #define HIKARI_CORE_GAME_ANIMATIONFRAME 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/geom/Point2D.hpp" 6 | #include "hikari/core/geom/Rectangle2D.hpp" 7 | 8 | namespace hikari { 9 | 10 | class HIKARI_API AnimationFrame { 11 | private: 12 | Rectangle2D sourceRect; 13 | Point2D hotspot; 14 | float displayTime; 15 | 16 | public: 17 | AnimationFrame(const Rectangle2D &sourceRect, const float &displayTime, const Point2D &hotspot = Point2D(0, 0)); 18 | 19 | const Rectangle2D& getSourceRectangle() const; 20 | const Point2D& getHotspot() const; 21 | const float& getDisplayTime() const; 22 | 23 | void setSourceRectangle(const Rectangle2D &newSourceRect); 24 | void setHotspot(const Point2D &newHotspot); 25 | void setDisplayTime(const float &newTime); 26 | }; 27 | 28 | } // hikari 29 | 30 | #endif // HIKARI_CORE_GAME_ANIMATIONFRAME -------------------------------------------------------------------------------- /engine/include/hikari/core/game/GameState.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_GAMESTATE 2 | #define HIKARI_CORE_GAME_GAMESTATE 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include 6 | 7 | namespace sf { 8 | class Event; 9 | class RenderTarget; 10 | } 11 | 12 | namespace hikari { 13 | 14 | class HIKARI_API GameState { 15 | public: 16 | virtual ~GameState() {} 17 | 18 | virtual void handleEvent(sf::Event &event) = 0; 19 | virtual void render(sf::RenderTarget &target) = 0; 20 | 21 | /** 22 | Updates this state's logic, given that dt milliseconds have elapsed 23 | since it's last update. 24 | 25 | @return false if this state should keep running, true if it is time 26 | to transition to a new state 27 | */ 28 | virtual bool update(float dt) = 0; 29 | virtual void onEnter() = 0; 30 | virtual void onExit() = 0; 31 | virtual const std::string &getName() const = 0; 32 | }; 33 | 34 | } // hikari 35 | 36 | #endif // HIKARI_CORE_GAME_GAMESTATE -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/GameObject.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_GAMEOBJECT 2 | #define HIKARI_CLIENT_GAME_GAMEOBJECT 3 | 4 | #include "hikari/core/game/Updatable.hpp" 5 | 6 | namespace hikari { 7 | 8 | class GameObject : public Updatable { 9 | // 10 | // Static members 11 | // 12 | public: 13 | static const int generateObjectId(); 14 | 15 | private: 16 | static int nextId; 17 | 18 | // 19 | // Class members 20 | // 21 | private: 22 | int id; 23 | bool active; 24 | 25 | protected: 26 | virtual void onActivated(); 27 | virtual void onDeactivated(); 28 | 29 | public: 30 | explicit GameObject(int id = generateObjectId()); 31 | virtual ~GameObject(); 32 | 33 | int getId() const; 34 | 35 | bool isActive() const; 36 | void setActive(bool active); 37 | 38 | virtual void update(float dt); 39 | 40 | virtual void reset(); 41 | }; 42 | 43 | } // hikari 44 | 45 | #endif // HIKARI_CLIENT_GAME_GAMEOBJECT -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | 9 | # Compiled Static libraries 10 | *.lai 11 | *.la 12 | *.a 13 | 14 | #OS junk files 15 | [Tt]humbs.db 16 | *.DS_Store 17 | 18 | #Visual Studio files 19 | *.[Oo]bj 20 | *.user 21 | *.aps 22 | *.pch 23 | *.vspscc 24 | *.vssscc 25 | *_i.c 26 | *_p.c 27 | *.dsw 28 | *.ncb 29 | *.suo 30 | *.tlb 31 | *.tlh 32 | *.bak 33 | *.[Cc]ache 34 | *.ilk 35 | *.log 36 | *.lib 37 | *.sbr 38 | *.sdf 39 | *.opensdf 40 | *.unsuccessfulbuild 41 | ipch/ 42 | obj/ 43 | [Bb]in 44 | [Dd]ebug*/ 45 | [Rr]elease*/ 46 | 47 | #Tooling 48 | _ReSharper*/ 49 | *.resharper 50 | [Tt]est[Rr]esult* 51 | 52 | #Project files 53 | [Bb]uild/ 54 | 55 | #Subversion files 56 | .svn 57 | 58 | # Office Temp Files 59 | ~$* 60 | 61 | # Visual Studio database projects 62 | *.dbmdl 63 | 64 | #Test files 65 | *.testsettings 66 | 67 | #Code::Blocks files 68 | *.cbp 69 | *.depend 70 | *.layout 71 | 72 | #Hikari Specific Ignores 73 | doc/ 74 | junk/ 75 | *.sublime-project 76 | *.sublime-workspace 77 | *.test.json 78 | *.bak 79 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/ObjectRemovedEventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_OBJECTREMOVEDEVENTDATA 2 | #define HIKARI_CLIENT_OBJECTREMOVEDEVENTDATA 3 | 4 | #include "hikari/client/game/events/BaseEventData.hpp" 5 | 6 | namespace hikari { 7 | 8 | /** 9 | * An event to be fired when a GameObject is removed from the GameWorld. 10 | */ 11 | class ObjectRemovedEventData : public BaseEventData { 12 | public: 13 | static const EventType Type; 14 | 15 | private: 16 | int objectId; 17 | 18 | public: 19 | explicit ObjectRemovedEventData(int objectId); 20 | virtual ~ObjectRemovedEventData(); 21 | 22 | /** 23 | * Gets the ID of the object that was removed. 24 | * @return the ID of the removed object 25 | */ 26 | int getObjectId() const; 27 | 28 | virtual const EventType & getEventType() const; 29 | 30 | virtual EventDataPtr copy() const; 31 | virtual const char * getName() const; 32 | }; 33 | 34 | } // hikari 35 | 36 | #endif // HIKARI_CLIENT_OBJECTREMOVEDEVENTDATA -------------------------------------------------------------------------------- /engine/include/hikari/client/game/EndingState.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_ENDINGSTATE 2 | #define HIKARI_CLIENT_GAME_ENDINGSTATE 3 | 4 | #include "hikari/core/game/GameState.hpp" 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace hikari { 11 | namespace client { 12 | namespace game { 13 | 14 | class EndingState : public hikari::core::game::GameState { 15 | private: 16 | std::string name; 17 | sf::RenderTarget ⌖ 18 | sf::View view; 19 | 20 | public: 21 | EndingState(const Json::Value ¶ms); 22 | virtual ~EndingState() {} 23 | 24 | virtual void handleEvent(sf::Event &event); 25 | virtual void render(sf::RenderTarget &target); 26 | virtual bool update(const float &dt); 27 | virtual void onEnter(); 28 | virtual void onExit(); 29 | virtual const std::string &getName() const; 30 | }; 31 | 32 | } // hikari.client.game 33 | } // hikari.client 34 | } // hikari 35 | 36 | #endif // HIKARI_CLIENT_GAME_ENDINGSTATE -------------------------------------------------------------------------------- /engine/src/hikari/core/game/SliceStateTransition.hpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/game/StateTransition.hpp" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class SliceStateTransition : public StateTransition { 10 | public: 11 | enum SliceDirection { 12 | SLICE_LEFT = 0, 13 | SLICE_RIGHT = 1 14 | }; 15 | 16 | private: 17 | SliceDirection direction; 18 | const float duration; 19 | float accumulator; 20 | sf::RectangleShape overlay; 21 | sf::RenderTexture exitingStateTexture; 22 | sf::RenderTexture enteringStateTexture; 23 | sf::Sprite exitingStateSpriteLayer; 24 | sf::Sprite enteringStateSpriteLayer; 25 | 26 | public: 27 | SliceStateTransition(SliceDirection direction, float duration); 28 | virtual ~SliceStateTransition(); 29 | 30 | virtual void render(sf::RenderTarget &target); 31 | virtual void update(float dt); 32 | }; 33 | 34 | } // hikari 35 | -------------------------------------------------------------------------------- /engine/include/hikari/core/util/ImageCache.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_IMAGECACHE 2 | #define HIKARI_CORE_UTIL_IMAGECACHE 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/util/ResourceCache.hpp" 6 | #include "hikari/core/util/Service.hpp" 7 | 8 | #include 9 | #include 10 | 11 | namespace hikari { 12 | 13 | class HIKARI_API ImageCache : public Service, public ResourceCache { 14 | public: 15 | static const bool USE_SMOOTHING; 16 | static const bool NO_SMOOTHING; 17 | static const bool USE_MASKING; 18 | static const bool NO_MASKING; 19 | 20 | private: 21 | bool enableSmoothing; 22 | bool enableMask; 23 | sf::Color maskColor; 24 | 25 | protected: 26 | virtual ImageCache::Resource loadResource(const std::string &fileName); 27 | 28 | public: 29 | ImageCache(bool smoothing, bool masking, const sf::Color &mask = sf::Color(255, 0, 255)); 30 | 31 | virtual ~ImageCache() { } 32 | }; 33 | 34 | } // hikari 35 | 36 | #endif // HIKARI_CORE_UTIL_IMAGECACHE -------------------------------------------------------------------------------- /engine/src/hikari/core/game/AnimationFrame.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/game/AnimationFrame.hpp" 2 | 3 | namespace hikari { 4 | 5 | AnimationFrame::AnimationFrame(const Rectangle2D &sourceRect, const float &displayTime, const Point2D &hotspot) 6 | : sourceRect(sourceRect) 7 | , hotspot(hotspot) 8 | , displayTime(displayTime) 9 | { 10 | 11 | } 12 | 13 | const Rectangle2D& AnimationFrame::getSourceRectangle() const { 14 | return sourceRect; 15 | } 16 | 17 | const Point2D& AnimationFrame::getHotspot() const { 18 | return hotspot; 19 | } 20 | 21 | const float& AnimationFrame::getDisplayTime() const { 22 | return displayTime; 23 | } 24 | 25 | void AnimationFrame::setSourceRectangle(const Rectangle2D &newSourceRect) { 26 | sourceRect = newSourceRect; 27 | } 28 | 29 | void AnimationFrame::setHotspot(const Point2D &newHotspot) { 30 | hotspot = newHotspot; 31 | } 32 | 33 | void AnimationFrame::setDisplayTime(const float &newTime) { 34 | displayTime = newTime; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /extlibs/squirrel/README: -------------------------------------------------------------------------------- 1 | The programming language SQUIRREL 3.1 stable 2 | 3 | -------------------------------------------------- 4 | This project has successfully been compiled and run on 5 | * Windows (x86 and amd64) 6 | * Linux (x86, amd64 and ARM) 7 | * Illumos (x86 and amd64) 8 | 9 | The following compilers have been confirmed to be working: 10 | MS Visual C++ 6.0 (all on x86 and amd64) 11 | 7.0 | 12 | 7.1 v 13 | 8.0 14 | 9.0 15 | 10.0 16 | 12.0 --- 17 | MinGW gcc 3.2 (mingw special 20020817-1) 18 | Cygnus gcc 3.2 19 | Linux gcc 3.2.3 20 | 4.0.0 (x86 and amd64) 21 | 5.3.1 (amd64) 22 | Illumos gcc 4.0.0 (x86 and amd64) 23 | ARM Linux gcc 4.6.3 (Raspberry Pi Model B) 24 | 25 | 26 | Feedback and suggestions are appreciated 27 | project page - http://www.squirrel-lang.org 28 | community forums - http://forum.squirrel-lang.org 29 | wiki - http://wiki.squirrel-lang.org 30 | author - alberto@demichelis.net 31 | 32 | END OF README 33 | -------------------------------------------------------------------------------- /extlibs/knhit/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2010 Roger Pate 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /extlibs/physfs-stream/physfs/ifile_stream.cpp: -------------------------------------------------------------------------------- 1 | // SuperTux 2 | // Copyright (C) 2006 Matthias Braun 3 | // 4 | // This program is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | 17 | #include "physfs/ifile_stream.hpp" 18 | 19 | #include "physfs/ifile_streambuf.hpp" 20 | 21 | IFileStream::IFileStream(const std::string& filename) : 22 | std::istream(new IFileStreambuf(filename)) 23 | { 24 | } 25 | 26 | IFileStream::~IFileStream() 27 | { 28 | delete rdbuf(); 29 | } 30 | 31 | /* EOF */ 32 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/EntityDeathEventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_ENTITYDEATHEVENTDATA 2 | #define HIKARI_CLIENT_ENTITYDEATHEVENTDATA 3 | 4 | #include "hikari/client/game/events/BaseEventData.hpp" 5 | 6 | namespace hikari { 7 | 8 | class EntityDeathEventData : public BaseEventData { 9 | public: 10 | static const EventType Type; 11 | 12 | enum EntityType { 13 | Unknown = 1, 14 | Hero = 2, 15 | Enemy = 3, 16 | Projectile = 4, 17 | Item = 5 18 | }; 19 | 20 | private: 21 | int entityId; 22 | EntityType entityType; 23 | 24 | public: 25 | explicit EntityDeathEventData(int entityId, EntityType entityType = Unknown); 26 | virtual ~EntityDeathEventData(); 27 | 28 | int getEntityId() const; 29 | EntityType getEntityType() const; 30 | 31 | virtual const EventType & getEventType() const; 32 | 33 | virtual EventDataPtr copy() const; 34 | virtual const char * getName() const; 35 | }; 36 | 37 | } // hikari 38 | 39 | #endif // HIKARI_CLIENT_ENTITYDEATHEVENTDATA -------------------------------------------------------------------------------- /engine/src/hikari/core/game/CollisionInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/game/CollisionInfo.hpp" 2 | 3 | namespace hikari { 4 | 5 | CollisionInfo::CollisionInfo() 6 | : treatPlatformAsGround(true) 7 | , isCollisionX(false) 8 | , isCollisionY(false) 9 | , worldX(0) 10 | , worldY(0) 11 | , directionX(Directions::None) 12 | , directionY(Directions::None) 13 | , tileX(0) 14 | , tileY(0) 15 | , correctedX(0) 16 | , correctedY(0) 17 | , tileType(0) 18 | , inheritedVelocityX(0) 19 | , inheritedVelocityY(0) 20 | { 21 | 22 | } 23 | 24 | void CollisionInfo::clear() { 25 | treatPlatformAsGround = true; 26 | isCollisionX = false; 27 | isCollisionY = false; 28 | worldX = 0; 29 | worldY = 0; 30 | directionX = Directions::None; 31 | directionY = Directions::None; 32 | tileX = 0; 33 | tileY = 0; 34 | correctedX = 0; 35 | correctedY = 0; 36 | tileType = 0; 37 | inheritedVelocityX = 0; 38 | inheritedVelocityY = 0; 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /engine/include/hikari/client/gui/Widget.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GUI_WIDGET 2 | #define HIKARI_CORE_GUI_WIDGET 3 | 4 | #include 5 | #include 6 | 7 | namespace sf { 8 | class RenderTarget; 9 | } 10 | 11 | namespace hikari { 12 | namespace gui { 13 | 14 | class Widget { 15 | private: 16 | int id; 17 | bool visible; 18 | sf::Vector2i position; 19 | 20 | std::weak_ptr parent; 21 | public: 22 | virtual ~Widget() {} 23 | 24 | const std::weak_ptr & getParent() const; 25 | void setParent(const std::weak_ptr & newParent); 26 | 27 | virtual const sf::Vector2i& getPosition() const; 28 | virtual void setPosition(const sf::Vector2i &newPosition); 29 | 30 | const bool& isVisible() const; 31 | void setVisible(const bool &isVisible); 32 | 33 | virtual void render(sf::RenderTarget &target) = 0; 34 | virtual void update(const float &delta) = 0; 35 | }; 36 | 37 | typedef std::shared_ptr WidgetPtr; 38 | 39 | } // hikari::gui 40 | } // hikari 41 | 42 | #endif // HIKARI_CORE_GUI_WIDGET -------------------------------------------------------------------------------- /engine/src/hikari/core/game/Animation.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/game/Animation.hpp" 2 | 3 | namespace hikari { 4 | 5 | const bool Animation::ANIMATION_DEFAULT_REPEAT_SETTING = false; 6 | const unsigned int Animation::ANIMATION_BEGINNING_FRAME_INDEX = 0; 7 | const unsigned int Animation::ANIMATION_DEFAULT_SYNC_GROUP = 0; 8 | 9 | Animation::Animation(const FrameList &frames, bool doesRepeat, unsigned int keyframe, unsigned int syncGroup) 10 | : repeat(doesRepeat) 11 | , keyframe(keyframe) 12 | , syncGroup(syncGroup) 13 | , frames(frames) 14 | { 15 | 16 | } 17 | 18 | bool Animation::doesRepeat() const { 19 | return repeat; 20 | } 21 | 22 | unsigned int Animation::getKeyframeIndex() const { 23 | return keyframe; 24 | } 25 | 26 | unsigned int Animation::getNumberOfFrames() const { 27 | return frames.size(); 28 | } 29 | 30 | unsigned int Animation::getSyncGroup() const { 31 | return syncGroup; 32 | } 33 | 34 | const Frame& Animation::getFrameAt(unsigned int index) const { 35 | return frames.at(index); 36 | } 37 | 38 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/client/game/BaseTask.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_BASETASK 2 | #define HIKARI_CLIENT_GAME_BASETASK 3 | 4 | #include "hikari/client/game/Task.hpp" 5 | 6 | namespace hikari { 7 | 8 | /** 9 | * A task is a class that encapsulates some kind of job that is completed 10 | * on a schedule. Some tasks may require multiple updates before they are 11 | * completed. Some tasks can block, which prevents other tasks from 12 | * executing, while others run in parallel. 13 | */ 14 | class BaseTask : public Task { 15 | private: 16 | SequenceType sequenceType; 17 | int priority; 18 | bool completedFlag; 19 | 20 | protected: 21 | virtual void markAsCompleted(); 22 | 23 | public: 24 | explicit BaseTask(int priority, SequenceType type = TYPE_PARALLEL); 25 | virtual ~BaseTask(); 26 | 27 | virtual bool isComplete() const; 28 | virtual int getPriority() const; 29 | virtual Task::SequenceType getSequenceType() const; 30 | 31 | virtual void update(float dt); 32 | }; 33 | 34 | } // hikari 35 | 36 | #endif // HIKARI_CLIENT_GAME_BASETASK -------------------------------------------------------------------------------- /content/assets/scripts/behaviors/PeterchyEnemyBehavior.nut: -------------------------------------------------------------------------------- 1 | class PeterchyEnemyBehavior extends EnemyBehavior { 2 | direction = Directions.Left; 3 | 4 | constructor(classConfig = {}) { 5 | base.constructor(classConfig); 6 | ::log("PeterchyEnemyBehavior constructor called."); 7 | } 8 | 9 | function update(dt) { 10 | if(host != null) { 11 | 12 | switch(direction) { 13 | case Directions.Left: 14 | host.velocityX = -0.5; 15 | break; 16 | 17 | case Directions.Right: 18 | host.velocityX = 0.5; 19 | break; 20 | 21 | default: 22 | break; 23 | } 24 | 25 | host.direction = direction; 26 | } 27 | 28 | base.update(dt); 29 | } 30 | 31 | function handleWorldCollision(side) { 32 | if(side == Directions.Left) { 33 | direction = Directions.Right; 34 | } else if(side == Directions.Right) { 35 | direction = Directions.Left; 36 | } 37 | } 38 | } 39 | 40 | ::log("PeterchyEnemyBehavior.nut executed!"); 41 | -------------------------------------------------------------------------------- /extlibs/physfs-stream/physfs/ifile_stream.hpp: -------------------------------------------------------------------------------- 1 | // SuperTux 2 | // Copyright (C) 2006 Matthias Braun 3 | // 4 | // This program is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | 17 | #ifndef HEADER_SUPERTUX_PHYSFS_IFILE_STREAM_HPP 18 | #define HEADER_SUPERTUX_PHYSFS_IFILE_STREAM_HPP 19 | 20 | #include 21 | #include 22 | 23 | class IFileStream : public std::istream 24 | { 25 | public: 26 | IFileStream(const std::string& filename); 27 | ~IFileStream(); 28 | }; 29 | 30 | #endif 31 | 32 | /* EOF */ 33 | -------------------------------------------------------------------------------- /extlibs/physfs-stream/physfs/ofile_stream.hpp: -------------------------------------------------------------------------------- 1 | // SuperTux 2 | // Copyright (C) 2006 Matthias Braun 3 | // 4 | // This program is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | 17 | #ifndef HEADER_SUPERTUX_PHYSFS_OFILE_STREAM_HPP 18 | #define HEADER_SUPERTUX_PHYSFS_OFILE_STREAM_HPP 19 | 20 | #include 21 | #include 22 | 23 | class OFileStream : public std::ostream 24 | { 25 | public: 26 | OFileStream(const std::string& filename); 27 | ~OFileStream(); 28 | }; 29 | 30 | #endif 31 | 32 | /* EOF */ 33 | -------------------------------------------------------------------------------- /content/assets/scripts/behaviors/AppearingBlockBehavior.nut: -------------------------------------------------------------------------------- 1 | class AppearingBlockBehavior extends DoodadBehavior { 2 | previousObstacleStatus = false; 3 | 4 | constructor(_classConfig = {}) { 5 | base.constructor(_classConfig); 6 | } 7 | 8 | function update(dt) { 9 | base.update(dt); 10 | } 11 | 12 | /** 13 | * Attaches to a host object; sets up initial config. 14 | * @override 15 | */ 16 | function attachHost(newHost, instanceConfig = {}) { 17 | base.attachHost(newHost, instanceConfig); 18 | 19 | if(host) { 20 | host.changeAnimation(("animation" in classConfig) ? classConfig.animation : "appearing-block-blue"); 21 | host.isObstacle = true; 22 | host.isShielded = false; 23 | host.isPhasing = true; 24 | host.faction = Factions.World; 25 | host.direction = Directions.Down; 26 | host.liveOffscreen = true; 27 | } 28 | } 29 | 30 | function onActivated() { 31 | // TODO: Restart animation so it looks like it's appearing. 32 | } 33 | } 34 | 35 | ::log("AppearingBlockBehavior.nut executed!"); 36 | 37 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/InputService.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_INPUTSERVICE 2 | #define HIKARI_CLIENT_GAME_INPUTSERVICE 3 | 4 | #include "hikari/client/game/Input.hpp" 5 | #include "hikari/core/util/Service.hpp" 6 | 7 | #include 8 | 9 | namespace hikari { 10 | 11 | /** 12 | * InputService is a decroator for an Input instance that exposes 13 | * the wrapped Input as a service. 14 | */ 15 | class InputService : public Input, public Service { 16 | private: 17 | std::shared_ptr input; 18 | 19 | public: 20 | InputService(const std::shared_ptr & input); 21 | virtual ~InputService(); 22 | 23 | virtual const bool isUp(const Input::Button &button) const; 24 | virtual const bool isDown(const Input::Button &button) const; 25 | virtual const bool isHeld(const Input::Button &button) const; 26 | virtual const bool wasPressed(const Input::Button &button) const; 27 | virtual const bool wasReleased(const Input::Button &button) const; 28 | virtual void update(float dt); 29 | }; 30 | 31 | } // hikari 32 | 33 | #endif // HIKARI_CLIENT_GAME_INPUTSERVICE -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set( CMAKE_INCLUDE_CURRENT_DIR ON ) 2 | 3 | set( TEST_BASE_DIR "${PROJECT_SOURCE_DIR}/tests" ) 4 | set( ENGINE_BASE_DIR "${PROJECT_SOURCE_DIR}/engine" ) 5 | 6 | set( INCLUDE_DIRS 7 | ${TEST_BASE_DIR}/include 8 | ${ENGINE_BASE_DIR}/include 9 | ) 10 | 11 | set( REQUIRED_HIKARI_SOURCE_FILES 12 | ${ENGINE_BASE_DIR}/src/hikari/client/game/events/EventBus.cpp 13 | ${ENGINE_BASE_DIR}/src/hikari/client/game/events/EventBusImpl.cpp 14 | ${ENGINE_BASE_DIR}/src/hikari/client/game/events/EventListenerDelegate.cpp 15 | ${ENGINE_BASE_DIR}/src/hikari/client/game/events/EventData.cpp 16 | ${ENGINE_BASE_DIR}/src/hikari/client/game/events/BaseEventData.cpp 17 | ${ENGINE_BASE_DIR}/src/hikari/core/util/Log.cpp 18 | ) 19 | 20 | set( TEST_SOURCE_FILES 21 | ${REQUIRED_HIKARI_SOURCE_FILES} 22 | src/test/Main.cpp 23 | src/test/TestVector2.cpp 24 | src/test/TestPoint2D.cpp 25 | src/test/TestRectangle2D.cpp 26 | src/test/TestBoundingBox.cpp 27 | src/test/TestGeometryUtils.cpp 28 | src/test/TestEventBusImpl.cpp 29 | ) 30 | 31 | include_directories( ${INCLUDE_DIRS} ) 32 | 33 | add_executable( tests ${TEST_SOURCE_FILES} ${INCLUDE_DIRS} ) 34 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/RefillHealthTask.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_REFILL_HEALTH_TASK 2 | #define HIKARI_CLIENT_GAME_REFILL_HEALTH_TASK 3 | 4 | #include "hikari/client/game/BaseTask.hpp" 5 | #include 6 | 7 | namespace hikari { 8 | 9 | class AudioService; 10 | class GameProgress; 11 | 12 | class RefillHealthTask : public BaseTask { 13 | public: 14 | enum RefillType { 15 | PLAYER_ENERGY, 16 | WEAPON_ENERGY, 17 | BOSS_ENERGY 18 | }; 19 | 20 | private: 21 | const static float DELAY_PER_HEALTH_TICK; 22 | RefillType type; 23 | int refillCounter; 24 | float delayTimer; 25 | std::weak_ptr audioService; 26 | std::weak_ptr gameProgress; 27 | 28 | public: 29 | RefillHealthTask(RefillType type, int refillAmount, 30 | const std::weak_ptr & audioService, 31 | const std::weak_ptr & gameProgress); 32 | 33 | virtual ~RefillHealthTask(); 34 | 35 | virtual void update(float dt); 36 | }; 37 | 38 | } // hikari 39 | 40 | #endif // HIKARI_CLIENT_GAME_REFILL_HEALTH_TASK -------------------------------------------------------------------------------- /engine/include/hikari/client/game/FadeColorTask.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_FADE_COLOR_TASK 2 | #define HIKARI_CLIENT_GAME_FADE_COLOR_TASK 3 | 4 | #include "hikari/client/game/BaseTask.hpp" 5 | 6 | #include 7 | #include 8 | 9 | namespace hikari { 10 | 11 | /** 12 | * A Task which fades the color of an sf::RectangleShape in or out. Fades to 13 | * or from transparent. Takes a duration after which the fade is complete and 14 | * the task is marked as complete. 15 | */ 16 | class FadeColorTask : public BaseTask { 17 | public: 18 | enum FadeDirection { 19 | FADE_OUT = 0, 20 | FADE_IN = 1 21 | }; 22 | 23 | private: 24 | FadeDirection direction; 25 | sf::RectangleShape & rectangle; 26 | const float duration; 27 | float accumulator; 28 | 29 | public: 30 | FadeColorTask(FadeDirection direction, sf::RectangleShape & rectangle, 31 | float duration); 32 | 33 | virtual ~FadeColorTask(); 34 | 35 | virtual void update(float dt); 36 | }; 37 | 38 | } // hikari 39 | 40 | #endif // HIKARI_CLIENT_GAME_FADE_COLOR_TASK -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/ItemSpawner.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_ITEMSPAWNER 2 | #define HIKARI_CLIENT_GAME_OBJECTS_ITEMSPAWNER 3 | 4 | #include "hikari/client/game/objects/Spawner.hpp" 5 | 6 | #include 7 | #include 8 | 9 | namespace hikari { 10 | 11 | class CollectableItem; 12 | 13 | class ItemSpawner : public Spawner { 14 | private: 15 | int spawnedItemId; 16 | std::string itemName; 17 | bool canSpawnAgain; 18 | 19 | void handleEntityDeathEvent(EventDataPtr event); 20 | 21 | public: 22 | ItemSpawner(const std::string & itemNam); 23 | virtual ~ItemSpawner(); 24 | 25 | virtual void performAction(GameWorld & world); 26 | virtual void attachEventListeners(EventBus & EventBus); 27 | virtual void detachEventListeners(EventBus & EventBus); 28 | 29 | virtual bool canSpawn() const; 30 | 31 | virtual void onSleep(); 32 | 33 | // 34 | // GameObject overrides 35 | // 36 | virtual void onActivated(); 37 | virtual void onDeactivated(); 38 | }; 39 | 40 | } // hikari 41 | 42 | #endif // HIKARI_CLIENT_GAME_OBJECTS_ITEMSPAWNER -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/ObjectRemovedEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/ObjectRemovedEventData.hpp" 2 | #include "hikari/core/util/HashedString.hpp" 3 | #include "hikari/core/util/Log.hpp" 4 | 5 | namespace hikari { 6 | 7 | const EventType ObjectRemovedEventData::Type = HashedString("ObjectRemovedEventData").getHash(); 8 | 9 | ObjectRemovedEventData::ObjectRemovedEventData(int objectId) 10 | : BaseEventData(0.0f) 11 | , objectId(objectId) 12 | { 13 | 14 | } 15 | 16 | int ObjectRemovedEventData::getObjectId() const { 17 | return objectId; 18 | } 19 | 20 | ObjectRemovedEventData::~ObjectRemovedEventData() { 21 | // Do nothing! 22 | HIKARI_LOG(debug1) << "~ObjectRemovedEventData()"; 23 | } 24 | 25 | const EventType & ObjectRemovedEventData::getEventType() const { 26 | return ObjectRemovedEventData::Type; 27 | } 28 | 29 | EventDataPtr ObjectRemovedEventData::copy() const { 30 | return EventDataPtr(new ObjectRemovedEventData(getObjectId())); 31 | } 32 | 33 | const char * ObjectRemovedEventData::getName() const { 34 | return "ObjectRemovedEventData"; 35 | } 36 | 37 | } // hikari -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/RockmanHero.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_ROCKMANHERO 3 | #define HIKARI_CLIENT_GAME_OBJECTS_ROCKMANHERO 4 | 5 | #include "hikari/client/game/objects/Hero.hpp" 6 | #include "hikari/client/game/Input.hpp" 7 | #include "hikari/core/game/AnimationSet.hpp" 8 | #include "hikari/core/game/SpriteAnimator.hpp" 9 | 10 | #include 11 | 12 | namespace hikari { 13 | 14 | class RockmanHero : public Hero { 15 | private: 16 | // Flags 17 | bool isShooting; 18 | bool isSliding; 19 | 20 | // Timers 21 | float shootingTimer; 22 | float slidingTimer; 23 | 24 | std::shared_ptr animations; 25 | SpriteAnimator animator; 26 | 27 | std::shared_ptr input; 28 | public: 29 | RockmanHero(const int& id, std::shared_ptr animations, std::shared_ptr input); 30 | void setAnimationSet(std::shared_ptr animations); 31 | virtual ~RockmanHero(); 32 | virtual void render(sf::RenderTarget &target); 33 | virtual void update(const float &dt); 34 | }; 35 | 36 | } 37 | 38 | #endif // HIKARI_CLIENT_GAME_OBJECTS_HERO 39 | */ -------------------------------------------------------------------------------- /engine/include/hikari/core/game/Renderable.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_RENDERABLE 2 | #define HIKARI_CLIENT_GAME_RENDERABLE 3 | 4 | namespace sf { 5 | class RenderTarget; 6 | } 7 | 8 | namespace hikari { 9 | 10 | /** 11 | * Interface for all things that can be rendered to the screen. 12 | */ 13 | class Renderable { 14 | public: 15 | /** 16 | * Virtual destructor; standard stuff. 17 | */ 18 | virtual ~Renderable() { 19 | // no-op 20 | } 21 | 22 | /** 23 | * Renders an object to the render target. 24 | * @param target the render target 25 | */ 26 | virtual void render(sf::RenderTarget & target) = 0; 27 | 28 | /** 29 | * Sets the z-index of this Renderable. The z-index affects rendering order. 30 | * @param index a new value for this object's z-index 31 | */ 32 | virtual void setZIndex(int index) = 0; 33 | 34 | /** 35 | * Gets the z-index of this Renderable. 36 | * @return the z-index 37 | */ 38 | virtual int getZIndex() const = 0; 39 | }; 40 | 41 | } // hikari 42 | 43 | #endif // HIKARI_CLIENT_GAME_RENDERABLE 44 | -------------------------------------------------------------------------------- /content/tileset-skull.json: -------------------------------------------------------------------------------- 1 | { 2 | "surface" : "assets/images/tile-skull.png", 3 | "size" : 16, 4 | "tiles" : [ 5 | { "x" : 0, "y" : 0 }, 6 | { "x" : 0, "y" : 0 }, 7 | { "x" : 16, "y" : 0 }, 8 | { "x" : 32, "y" : 0 }, 9 | { "x" : 48, "y" : 0 }, 10 | { "x" : 0, "y" : 16 }, 11 | { "x" : 16, "y" : 16 }, 12 | { "x" : 32, "y" : 16 }, 13 | { "x" : 48, "y" : 16 }, 14 | { "x" : 0, "y" : 32 }, 15 | { "x" : 16, "y" : 32 }, 16 | { "x" : 32, "y" : 32 }, 17 | { "x" : 48, "y" : 32 }, 18 | { "x" : 0, "y" : 48 }, 19 | { "x" : 16, "y" : 48 }, 20 | { "x" : 32, "y" : 48 }, 21 | { "x" : 48, "y" : 48 }, 22 | { "x" : 0, "y" : 64 }, 23 | { "x" : 16, "y" : 64 }, 24 | { "x" : 32, "y" : 64 }, 25 | { "x" : 48, "y" : 64 }, 26 | { "x" : 0, "y" : 80 }, 27 | { "x" : 16, "y" : 80 }, 28 | { "x" : 32, "y" : 80 }, 29 | { "x" : 48, "y" : 80 }, 30 | { "x" : 0, "y" : 96 }, 31 | { "x" : 16, "y" : 96 }, 32 | { "x" : 32, "y" : 96 }, 33 | { "x" : 48, "y" : 96 }, 34 | { "x" : 0, "y" : 112 }, 35 | { "x" : 16, "y" : 112 } 36 | ] 37 | } 38 | 39 | -------------------------------------------------------------------------------- /content/assets/scripts/behaviors/DoodadBehavior.nut: -------------------------------------------------------------------------------- 1 | class DoodadBehavior extends EnemyBehavior { 2 | classConfig = {}; 3 | isInitialized = false; 4 | 5 | constructor(_classConfig = {}) { 6 | base.constructor(_classConfig); 7 | classConfig = _classConfig; 8 | ::log("DoodadBehavior constructor called."); 9 | } 10 | 11 | function update(dt) { 12 | base.update(dt); 13 | } 14 | 15 | /** 16 | * Attaches to a host object; sets up initial config. 17 | * @override 18 | */ 19 | function attachHost(newHost, instanceConfig = {}) { 20 | base.attachHost(newHost, instanceConfig); 21 | 22 | if(host) { 23 | host.changeAnimation(("animation" in classConfig) ? classConfig.animation : "default"); 24 | host.isObstacle = true; 25 | host.isShielded = false; 26 | host.isPhasing = false; 27 | host.faction = Factions.World; 28 | host.direction = Directions.Down; 29 | isInitialized = true; 30 | } 31 | } 32 | 33 | function handleWorldCollision(side) { 34 | 35 | } 36 | 37 | function handleObjectTouch(otherId) { 38 | 39 | } 40 | } 41 | 42 | ::log("DoodadBehavior.nut executed!"); -------------------------------------------------------------------------------- /extlibs/squirrel/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003-2016 Alberto Demichelis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | ----------------------------------------------------- 21 | END OF COPYRIGHT 22 | -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/EntityDamageEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/EntityDamageEventData.hpp" 2 | #include "hikari/core/util/HashedString.hpp" 3 | 4 | namespace hikari { 5 | 6 | const EventType EntityDamageEventData::Type = HashedString("EntityDamageEventData").getHash(); 7 | 8 | EntityDamageEventData::EntityDamageEventData(int entityId, float amount) 9 | : BaseEventData(0.0f) 10 | , entityId(entityId) 11 | , amount(amount) 12 | { 13 | 14 | } 15 | 16 | int EntityDamageEventData::getEntityId() const { 17 | return entityId; 18 | } 19 | 20 | float EntityDamageEventData::getAmount() const { 21 | return amount; 22 | } 23 | 24 | EntityDamageEventData::~EntityDamageEventData() { 25 | // Do nothing! 26 | } 27 | 28 | const EventType & EntityDamageEventData::getEventType() const { 29 | return EntityDamageEventData::Type; 30 | } 31 | 32 | EventDataPtr EntityDamageEventData::copy() const { 33 | return EventDataPtr(new EntityDamageEventData(getEntityId(), getAmount())); 34 | } 35 | 36 | const char * EntityDamageEventData::getName() const { 37 | return "EntityDamageEventData"; 38 | } 39 | 40 | } // hikari -------------------------------------------------------------------------------- /content/assets/tilesets/tiles-skull.json: -------------------------------------------------------------------------------- 1 | { 2 | "surface" : "assets/images/tile-skull.png", 3 | "size" : 16, 4 | "tiles" : [ 5 | { "x" : 0, "y" : 0 }, 6 | { "x" : 0, "y" : 0 }, 7 | { "x" : 16, "y" : 0 }, 8 | { "x" : 32, "y" : 0 }, 9 | { "x" : 48, "y" : 0 }, 10 | { "x" : 0, "y" : 16 }, 11 | { "x" : 16, "y" : 16 }, 12 | { "x" : 32, "y" : 16 }, 13 | { "x" : 48, "y" : 16 }, 14 | { "x" : 0, "y" : 32 }, 15 | { "x" : 16, "y" : 32 }, 16 | { "x" : 32, "y" : 32 }, 17 | { "x" : 48, "y" : 32 }, 18 | { "x" : 0, "y" : 48 }, 19 | { "x" : 16, "y" : 48 }, 20 | { "x" : 32, "y" : 48 }, 21 | { "x" : 48, "y" : 48 }, 22 | { "x" : 0, "y" : 64 }, 23 | { "x" : 16, "y" : 64 }, 24 | { "x" : 32, "y" : 64 }, 25 | { "x" : 48, "y" : 64 }, 26 | { "x" : 0, "y" : 80 }, 27 | { "x" : 16, "y" : 80 }, 28 | { "x" : 32, "y" : 80 }, 29 | { "x" : 48, "y" : 80 }, 30 | { "x" : 0, "y" : 96 }, 31 | { "x" : 16, "y" : 96 }, 32 | { "x" : 32, "y" : 96 }, 33 | { "x" : 48, "y" : 96 }, 34 | { "x" : 0, "y" : 112 }, 35 | { "x" : 16, "y" : 112 } 36 | ] 37 | } 38 | 39 | -------------------------------------------------------------------------------- /engine/include/hikari/client/CommandProcessor.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_COMMANDPROCESSOR 2 | #define HIKARI_CLIENT_COMMANDPROCESSOR 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace hikari { 11 | 12 | class CommandProcessor { 13 | public: 14 | typedef std::vector ArgumentList; 15 | typedef std::tuple Command; 16 | typedef std::function CommandHandler; 17 | 18 | private: 19 | std::vector history; 20 | std::map handlers; 21 | 22 | const Command parseCommand(const std::string& commandString) const; 23 | // const ArgumentList parseCommandArguments(const std::string& commandString) const; 24 | 25 | public: 26 | void processCommand(const std::string& commandString); 27 | void processCommand(const std::string& command, const ArgumentList& args); 28 | 29 | void registerHandler(const std::string& commandName, const CommandHandler handler); 30 | void unregisterHandler(const std::string& commandName); 31 | }; 32 | 33 | } // hikari 34 | 35 | #endif // HIKARI_CLIENT_COMMANDPROCESSOR -------------------------------------------------------------------------------- /engine/src/hikari/client/game/FadeColorTask.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/FadeColorTask.hpp" 2 | #include "hikari/core/util/Log.hpp" 3 | 4 | namespace hikari { 5 | 6 | FadeColorTask::FadeColorTask(FadeDirection direction, sf::RectangleShape & rectangle, 7 | float duration) 8 | : BaseTask(0, Task::TYPE_BLOCKING) 9 | , direction(direction) 10 | , rectangle(rectangle) 11 | , duration(duration) 12 | , accumulator(0.0f) 13 | { 14 | 15 | } 16 | 17 | FadeColorTask::~FadeColorTask() { 18 | 19 | } 20 | 21 | void FadeColorTask::update(float dt) { 22 | accumulator += dt; 23 | 24 | sf::Color color = rectangle.getFillColor(); 25 | 26 | if(direction == FADE_OUT) { 27 | HIKARI_LOG(debug4) << "Fade out!!"; 28 | color.a = std::min(255, static_cast((accumulator / duration) * 255.0f)); 29 | } else { 30 | HIKARI_LOG(debug4) << "Fade in!!"; 31 | color.a = std::max(0, 255 - static_cast((accumulator / duration) * 255.0f)); 32 | } 33 | 34 | rectangle.setFillColor(color); 35 | 36 | if(accumulator >= duration) { 37 | markAsCompleted(); 38 | } 39 | } 40 | 41 | } // hikari 42 | -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/AudioEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/AudioEventData.hpp" 2 | #include "hikari/core/util/HashedString.hpp" 3 | 4 | namespace hikari { 5 | 6 | const EventType AudioEventData::Type = HashedString("AudioEventData").getHash(); 7 | const char * AudioEventData::NO_NAME = ""; 8 | 9 | AudioEventData::AudioEventData(AudioAction action, const std::string & name) 10 | : BaseEventData(0.0f) 11 | , action(action) 12 | , name(name) 13 | { 14 | 15 | } 16 | 17 | AudioEventData::~AudioEventData() { 18 | // Do nothing! 19 | } 20 | 21 | AudioEventData::AudioAction AudioEventData::getAudioAction() const { 22 | return action; 23 | } 24 | 25 | const std::string & AudioEventData::getMusicOrSampleName() const { 26 | return name; 27 | } 28 | 29 | const EventType & AudioEventData::getEventType() const { 30 | return AudioEventData::Type; 31 | } 32 | 33 | EventDataPtr AudioEventData::copy() const { 34 | return EventDataPtr(new AudioEventData(getAudioAction(), getName())); 35 | } 36 | 37 | const char * AudioEventData::getName() const { 38 | return "AudioEventData"; 39 | } 40 | 41 | } // hikari 42 | -------------------------------------------------------------------------------- /extlibs/physfs-stream/physfs/ofile_stream.cpp: -------------------------------------------------------------------------------- 1 | // SuperTux 2 | // Copyright (C) 2006 Matthias Braun 3 | // 4 | // This program is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | 17 | #ifndef HEADER_SUPERTUX_PHYSFS_OFILE_STREAM_CPP 18 | #define HEADER_SUPERTUX_PHYSFS_OFILE_STREAM_CPP 19 | 20 | #include "physfs/ofile_stream.hpp" 21 | 22 | #include "physfs/ofile_streambuf.hpp" 23 | 24 | OFileStream::OFileStream(const std::string& filename) : 25 | std::ostream(new OFileStreambuf(filename)) 26 | { 27 | } 28 | 29 | OFileStream::~OFileStream() 30 | { 31 | delete rdbuf(); 32 | } 33 | 34 | #endif 35 | 36 | /* EOF */ 37 | -------------------------------------------------------------------------------- /content/assets/animations/heroes.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rockman", 3 | "image": "assets/images/rock-test-run.png", 4 | "animations": { 5 | "idle": { 6 | "repeat": true, 7 | "keyframe": 1, 8 | "syncGroup": 0, 9 | "frames": [ 10 | { "x" : 22, "y" : 0, "width" : 22, "height" : 24, "hotspotX" : 19, "hotspotY" : 24, "length" : 0.1 }, 11 | { "x" : 0, "y" : 0, "width" : 22, "height" : 24, "hotspotX" : 19, "hotspotY" : 24, "length" : 1.5 }, 12 | { "x" : 117, "y" : 0, "width" : 22, "height" : 24, "hotspotX" : 19, "hotspotY" : 24, "length" : 0.15 } 13 | ] 14 | }, 15 | "running": { 16 | "repeat": true, 17 | "keyframe": 1, 18 | "syncGroup": 10, 19 | "frames": [ 20 | { "x" : 22, "y" : 0, "width" : 22, "height" : 24, "hotspotX" : 19, "hotspotY" : 24, "length" : 0.1 }, 21 | { "x" : 44, "y" : 0, "width" : 30, "height" : 24, "hotspotX" : 23, "hotspotY" : 24, "length" : 0.1 }, 22 | { "x" : 74, "y" : 0, "width" : 20, "height" : 24, "hotspotX" : 18, "hotspotY" : 24, "length" : 0.1167 }, 23 | { "x" : 94, "y" : 0, "width" : 22, "height" : 24, "hotspotX" : 19, "hotspotY" : 24, "length" : 0.1167 }, 24 | { "x" : 74, "y" : 0, "width" : 20, "height" : 24, "hotspotX" : 18, "hotspotY" : 24, "length" : 0.1167 } 25 | ] 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /extlibs/guichan-sfml/src/guichan/sfml/sfmlimageloader.cpp: -------------------------------------------------------------------------------- 1 | #include "guichan/sfml/sfmlimage.hpp" 2 | 3 | #include 4 | 5 | #include "guichan/exception.hpp" 6 | #include "guichan/sfml/sfmlimageloader.hpp" 7 | 8 | namespace gcn { 9 | Image* SFMLImageLoader::load(const std::string& filename, 10 | bool convertToDisplayFormat) 11 | { 12 | sf::Texture *loadedTexture = loadSFMLTexture(filename); 13 | 14 | if (loadedTexture == NULL) 15 | { 16 | throw GCN_EXCEPTION( 17 | std::string("Unable to load image file: ") + filename); 18 | } 19 | 20 | Image *image = new SFMLImage(loadedTexture, true); 21 | 22 | if (convertToDisplayFormat) 23 | { 24 | image->convertToDisplayFormat(); 25 | } 26 | 27 | return image; 28 | } 29 | 30 | sf::Texture* SFMLImageLoader::loadSFMLTexture(const std::string& filename) 31 | { 32 | sf::Texture *texture = new sf::Texture(); 33 | 34 | bool textureLoaded = texture->loadFromFile(filename); 35 | 36 | if(!textureLoaded) { 37 | delete texture; 38 | return NULL; 39 | } 40 | 41 | return texture; 42 | } 43 | } -------------------------------------------------------------------------------- /extlibs/physfs-stream/physfs/physfs_file_system.hpp: -------------------------------------------------------------------------------- 1 | // SuperTux 2 | // Copyright (C) 2009 Ingo Ruhnke 3 | // 4 | // This program is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | 17 | #ifndef HEADER_SUPERTUX_PHYSFS_FILE_SYSTEM_HPP 18 | #define HEADER_SUPERTUX_PHYSFS_FILE_SYSTEM_HPP 19 | 20 | #include 21 | #include 22 | 23 | class PhysFSFileSystem 24 | { 25 | public: 26 | PhysFSFileSystem(); 27 | 28 | std::vector open_directory(const std::string& pathname); 29 | std::unique_ptr open_file(const std::string& filename); 30 | }; 31 | 32 | #endif 33 | 34 | /* EOF */ 35 | 36 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/GuiTestState.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_GUITESTSTATE 2 | #define HIKARI_CLIENT_GAME_GUITESTSTATE 3 | 4 | #include "hikari/core/game/GameState.hpp" 5 | #include "hikari/core/gui/ImageFont.hpp" 6 | #include "hikari/client/gui/EnergyMeter.hpp" 7 | #include 8 | #include 9 | #include 10 | 11 | namespace sf { 12 | class RenderTarget; 13 | } 14 | 15 | namespace hikari { 16 | 17 | class GuiTestState : public GameState { 18 | private: 19 | std::string name; 20 | sf::Texture energyMeterImage; 21 | std::shared_ptr font; 22 | std::shared_ptr energyMeter; 23 | float ups; 24 | 25 | public: 26 | GuiTestState(const std::string &name, const std::shared_ptr &font); 27 | 28 | virtual ~GuiTestState() {} 29 | 30 | virtual void handleEvent(sf::Event &event); 31 | virtual void render(sf::RenderTarget &target); 32 | virtual bool update(float dt); 33 | virtual void onEnter(); 34 | virtual void onExit(); 35 | virtual const std::string &getName() const; 36 | }; 37 | 38 | } // hikari 39 | 40 | #endif // HIKARI_CLIENT_GAME_GUITESTSTATE -------------------------------------------------------------------------------- /engine/src/hikari/client/gui/HikariImageLoader.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/gui/HikariImageLoader.hpp" 2 | #include "guichan/sfml/sfmlimage.hpp" 3 | 4 | namespace hikari { 5 | namespace gui { 6 | 7 | HikariImageLoader::HikariImageLoader(const std::weak_ptr & imageCache) 8 | : imageCache(imageCache) 9 | { 10 | 11 | } 12 | 13 | HikariImageLoader::~HikariImageLoader() { 14 | 15 | } 16 | 17 | gcn::Image* HikariImageLoader::load(const std::string& filename, bool convertToDisplayFormat) { 18 | ImageCache::Resource loadedImage = loadTextureFromCache(filename); 19 | gcn::Image * image = nullptr; 20 | 21 | if(loadedImage) { 22 | image = new gcn::SFMLImage(loadedImage.get(), false); 23 | 24 | if (convertToDisplayFormat) { 25 | image->convertToDisplayFormat(); 26 | } 27 | } 28 | 29 | return image; 30 | } 31 | 32 | ImageCache::Resource HikariImageLoader::loadTextureFromCache(const std::string& filename) { 33 | ImageCache::Resource loadedImage; 34 | 35 | if(auto cache = imageCache.lock()) { 36 | loadedImage = cache->get(filename); 37 | } 38 | 39 | return loadedImage; 40 | } 41 | 42 | } // hikari::gui 43 | } // hikari -------------------------------------------------------------------------------- /engine/src/hikari/client/game/events/EntityDeathEventData.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/events/EntityDeathEventData.hpp" 2 | #include "hikari/core/util/HashedString.hpp" 3 | 4 | namespace hikari { 5 | 6 | const EventType EntityDeathEventData::Type = HashedString("EntityDeathEventData").getHash(); // was 0xdeadb33f; 7 | 8 | EntityDeathEventData::EntityDeathEventData(int entityId, EntityType entityType) 9 | : BaseEventData(0.0f) 10 | , entityId(entityId) 11 | , entityType(entityType) 12 | { 13 | 14 | } 15 | 16 | int EntityDeathEventData::getEntityId() const { 17 | return entityId; 18 | } 19 | 20 | EntityDeathEventData::EntityType EntityDeathEventData::getEntityType() const { 21 | return entityType; 22 | } 23 | 24 | EntityDeathEventData::~EntityDeathEventData() { 25 | // Do nothing! 26 | } 27 | 28 | const EventType & EntityDeathEventData::getEventType() const { 29 | return EntityDeathEventData::Type; 30 | } 31 | 32 | EventDataPtr EntityDeathEventData::copy() const { 33 | return EventDataPtr(new EntityDeathEventData(getEntityId())); 34 | } 35 | 36 | const char * EntityDeathEventData::getName() const { 37 | return "EntityDeathEventData"; 38 | } 39 | 40 | } // hikari -------------------------------------------------------------------------------- /engine/src/hikari/client/game/Shot.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/Shot.hpp" 2 | #include "hikari/client/game/objects/GameObject.hpp" 3 | 4 | #include "hikari/core/util/Log.hpp" 5 | 6 | namespace hikari { 7 | Shot::Shot(std::list> trackedObjects) 8 | : trackedObjects(trackedObjects) 9 | { 10 | HIKARI_LOG(debug4) << "Created Shot with " << trackedObjects.size() << " tracked objects!"; 11 | } 12 | 13 | Shot::Shot(const Shot & proto) 14 | : trackedObjects(proto.trackedObjects) 15 | { 16 | 17 | } 18 | 19 | bool Shot::isActive() const { 20 | for(auto i = std::begin(trackedObjects), end = std::end(trackedObjects); i != end; ++i) { 21 | const std::weak_ptr & trackedObjectWeak = *(i); 22 | 23 | if(std::shared_ptr trackedObject = trackedObjectWeak.lock()) { 24 | // If we find any objects that are still active then we must be 25 | // active too. If all tracked objects are no longer active then 26 | // the shot is not longer active. 27 | if(trackedObject->isActive()) { 28 | return true; 29 | } 30 | } 31 | } 32 | 33 | return false; 34 | } 35 | } // hikari 36 | -------------------------------------------------------------------------------- /engine/src/hikari/client/game/objects/GameObject.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/game/objects/GameObject.hpp" 2 | #include "hikari/core/util/Log.hpp" 3 | 4 | namespace hikari { 5 | 6 | /* static */ 7 | int GameObject::nextId = 1000; 8 | 9 | /* static */ 10 | const int GameObject::generateObjectId() { 11 | return nextId++; 12 | } 13 | 14 | GameObject::GameObject(int id) 15 | : id(id) 16 | , active(false) 17 | { 18 | 19 | } 20 | 21 | GameObject::~GameObject() { 22 | 23 | } 24 | 25 | int GameObject::getId() const { 26 | return id; 27 | } 28 | 29 | bool GameObject::isActive() const { 30 | return active; 31 | } 32 | 33 | void GameObject::setActive(bool active) { 34 | if(this->active != active) { 35 | this->active = active; 36 | 37 | if(this->active) { 38 | onActivated(); 39 | } else { 40 | onDeactivated(); 41 | } 42 | } 43 | } 44 | 45 | void GameObject::onActivated() { 46 | 47 | } 48 | 49 | void GameObject::onDeactivated() { 50 | 51 | } 52 | 53 | void GameObject::update(float dt) { 54 | 55 | } 56 | 57 | void GameObject::reset() { 58 | 59 | } 60 | 61 | } // hikari 62 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/EventBusService.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_EVENTBUSSERVICE 2 | #define HIKARI_CLIENT_EVENTBUSSERVICE 3 | 4 | #include "hikari/client/game/events/EventBus.hpp" 5 | #include "hikari/core/util/Service.hpp" 6 | 7 | namespace hikari { 8 | 9 | /** 10 | * Decorator class for an EventBus instance that exposes it as a service. 11 | */ 12 | class EventBusService : public EventBus, public Service { 13 | private: 14 | std::shared_ptr eventBus; 15 | 16 | public: 17 | EventBusService(const std::string & name, bool setAsGlobal); 18 | explicit EventBusService(const std::shared_ptr eventBus); 19 | virtual ~EventBusService(); 20 | 21 | virtual bool addListener(const EventListenerDelegate & eventDelegate, const EventType & type); 22 | virtual bool removeListener(const EventListenerDelegate & eventDelegate, const EventType & type); 23 | virtual bool triggerEvent(const EventDataPtr & event) const; 24 | virtual bool queueEvent(const EventDataPtr & event); 25 | virtual bool cancelEvent(const EventType & type, bool allOfType = false); 26 | virtual bool processEvents(unsigned long maxMillis = INFINITE); 27 | }; 28 | 29 | } // hikari 30 | 31 | #endif // HIKARI_CLIENT_EVENTBUSSERVICE -------------------------------------------------------------------------------- /engine/src/hikari/core/util/JsonUtil.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/util/JsonUtils.hpp" 2 | #include "hikari/core/util/FileSystem.hpp" 3 | #include "hikari/core/util/PhysFS.hpp" 4 | #include 5 | #include 6 | #include 7 | 8 | namespace hikari { 9 | 10 | Json::Value JsonUtils::loadJson(const std::string &fileName) { 11 | Json::Value root; 12 | Json::Reader reader; 13 | 14 | //PhysFS::FileStream fs(fileName.c_str(), PhysFS::OM_READ); 15 | auto fs = FileSystem::openFileRead(fileName); 16 | 17 | if(!fs->good()) { 18 | std::stringstream ss; 19 | 20 | ss << "I/O problem while loading JSON object from \""; 21 | ss << fileName; 22 | ss << "\""; 23 | 24 | throw std::runtime_error(ss.str().c_str()); 25 | } 26 | 27 | bool success = reader.parse(*fs, root); 28 | 29 | if(!success) { 30 | std::stringstream ss; 31 | 32 | ss << "There was a problem parsing a JSON object from \""; 33 | ss << fileName; 34 | ss << "\". "; 35 | ss << reader.getFormatedErrorMessages(); 36 | 37 | throw std::runtime_error(ss.str().c_str()); 38 | } 39 | 40 | return root; 41 | } 42 | 43 | } // hikari -------------------------------------------------------------------------------- /content/assets/scripts/EffectBase.nut: -------------------------------------------------------------------------------- 1 | /** 2 | * Base class for all scripted effects (extra lives, get weapon energy, get 3 | * health energy, etc.). Extend this class to implement a different kind of 4 | * effect. 5 | */ 6 | class EffectBase { 7 | /** 8 | * Constructor. Takes an optional configuration table for class-level 9 | * configuration settings. 10 | * 11 | * @param {Table} classConfig an optional table for class-level 12 | * configuration settings. 13 | */ 14 | constructor(config = {}) { 15 | ::log("EffectBase constructor called."); 16 | } 17 | 18 | /** 19 | * Called when the effect should be applied. This method is where the effect 20 | * applying logic is implemented. 21 | * 22 | * @see EffectBase::unapplyEffect 23 | */ 24 | function applyEffect() { 25 | ::log("EffectBase::applyEffect called."); 26 | } 27 | 28 | /** 29 | * Called when the effect should be unapplied (the reverse effect). This 30 | * method is where the logic to reverse the effect is implemented. 31 | * 32 | * @see EffectBase::applyEffect 33 | */ 34 | function unapplyEffect() { 35 | ::log("EffectBase::unapplyEffect called."); 36 | } 37 | } 38 | 39 | ::log("EffectBase.nut executed!"); -------------------------------------------------------------------------------- /engine/include/hikari/client/Services.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_SERVICES 2 | #define HIKARI_CLIENT_SERVICES 3 | 4 | #include 5 | 6 | namespace hikari { 7 | namespace Services { 8 | 9 | const static std::string AUDIO = "Audio"; 10 | const static std::string GAMEPROGRESS = "GameProgress"; 11 | const static std::string IMAGECACHE = "ImageCache"; 12 | const static std::string MAPLOADER = "MapLoader"; 13 | const static std::string SCRIPTING = "Scripting"; 14 | const static std::string GUIFONT = "GuiFont"; 15 | const static std::string GUISERVICE = "GuiService"; 16 | const static std::string ANIMATIONSETCACHE = "AnimationSetCache"; 17 | const static std::string ITEMFACTORY = "ItemFactory"; 18 | const static std::string ENEMYFACTORY = "EnemyFactory"; 19 | const static std::string PROJECTILEFACTORY = "ProjectileFactory"; 20 | const static std::string PARTICLEFACTORY = "ParticleFactory"; 21 | const static std::string WEAPONTABLE = "WeaponTable"; 22 | const static std::string DAMAGETABLE = "DamageTable"; 23 | const static std::string INPUT = "Input"; 24 | const static std::string EVENTBUS = "EventBus"; 25 | const static std::string SCREENEFFECTS = "ScreenEffects"; 26 | 27 | } // hikari::Services 28 | } // hikari 29 | 30 | #endif // HIKARI_CLIENT_GAME_DIRECTION 31 | -------------------------------------------------------------------------------- /engine/include/hikari/core/game/map/RoomTransition.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_GAME_MAP_ROOMTRANSITION 2 | #define HIKARI_CORE_GAME_MAP_ROOMTRANSITION 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/geom/Rectangle2D.hpp" 6 | 7 | namespace hikari { 8 | 9 | class HIKARI_API RoomTransition { 10 | public: 11 | enum Direction { 12 | DirectionUp = 0, 13 | DirectionForward = 1, 14 | DirectionDown = 2, 15 | DirectionBackward = 3, 16 | DirectionTeleport = 4 17 | }; 18 | 19 | RoomTransition(int from, int to, int width, int height, int x, int y, Direction dir, bool doorFlag, bool ladderOnly); 20 | 21 | bool isDoor() const; 22 | bool isLadderOnly() const; 23 | int getFromRegion() const; 24 | int getToRegion() const; 25 | int getWidth() const; 26 | int getHeight() const; 27 | int getX() const; 28 | int getY() const; 29 | Direction getDirection() const; 30 | 31 | private: 32 | bool doorFlag; 33 | bool ladderOnly; 34 | int fromRegion; 35 | int toRegion; 36 | Rectangle2D bounds; 37 | Direction direction; 38 | }; 39 | 40 | } // hikari 41 | 42 | #endif // HIKARI_CORE_GAME_MAP_ROOMTRANSITION -------------------------------------------------------------------------------- /extlibs/squirrel/include/sqstdstring.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_STRING_H_ 3 | #define _SQSTD_STRING_H_ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | typedef unsigned int SQRexBool; 10 | typedef struct SQRex SQRex; 11 | 12 | typedef struct { 13 | const SQChar *begin; 14 | SQInteger len; 15 | } SQRexMatch; 16 | 17 | SQUIRREL_API SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error); 18 | SQUIRREL_API void sqstd_rex_free(SQRex *exp); 19 | SQUIRREL_API SQBool sqstd_rex_match(SQRex* exp,const SQChar* text); 20 | SQUIRREL_API SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end); 21 | SQUIRREL_API SQBool sqstd_rex_searchrange(SQRex* exp,const SQChar* text_begin,const SQChar* text_end,const SQChar** out_begin, const SQChar** out_end); 22 | SQUIRREL_API SQInteger sqstd_rex_getsubexpcount(SQRex* exp); 23 | SQUIRREL_API SQBool sqstd_rex_getsubexp(SQRex* exp, SQInteger n, SQRexMatch *subexp); 24 | 25 | SQUIRREL_API SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen,SQChar **output); 26 | 27 | SQUIRREL_API SQRESULT sqstd_register_stringlib(HSQUIRRELVM v); 28 | 29 | #ifdef __cplusplus 30 | } /*extern "C"*/ 31 | #endif 32 | 33 | #endif /*_SQSTD_STRING_H_*/ 34 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/IntroState.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_INTROSTATE 2 | #define HIKARI_CLIENT_GAME_INTROSTATE 3 | 4 | #include "hikari/core/game/GameState.hpp" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace hikari { 12 | 13 | // Forward declaration 14 | namespace core { 15 | namespace gui { 16 | class ImageFont; 17 | } 18 | } 19 | 20 | namespace client { 21 | namespace game { 22 | 23 | class IntroState : public hikari::core::game::GameState { 24 | private: 25 | std::string name; 26 | sf::RenderTarget ⌖ 27 | sf::View view; 28 | std::shared_ptr guiFont; 29 | 30 | public: 31 | IntroState(const Json::Value ¶ms, std::shared_ptr guiFont); 32 | virtual ~IntroState() {} 33 | 34 | virtual void handleEvent(sf::Event &event); 35 | virtual void render(sf::RenderTarget &target); 36 | virtual bool update(const float &dt); 37 | virtual void onEnter(); 38 | virtual void onExit(); 39 | virtual const std::string &getName() const; 40 | }; 41 | 42 | } // hikari.client.game 43 | } // hikari.client 44 | } // hikari 45 | 46 | #endif -------------------------------------------------------------------------------- /engine/include/hikari/core/util/Timer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_TIMER 2 | #define HIKARI_CORE_UTIL_TIMER 3 | 4 | #include "hikari/core/Platform.hpp" 5 | #include "hikari/core/game/Updatable.hpp" 6 | #include 7 | 8 | namespace hikari { 9 | 10 | class Timer : public Updatable { 11 | public: 12 | typedef std::function TimerCallback; 13 | 14 | private: 15 | bool running; 16 | float elapsed; 17 | float interval; 18 | TimerCallback callback; 19 | static const TimerCallback DEFAULT_CALLBACK; 20 | 21 | public: 22 | explicit Timer(); 23 | explicit Timer(const float &interval); 24 | explicit Timer(const float &interval, const TimerCallback &callback); 25 | 26 | virtual ~Timer() { } 27 | 28 | Timer& setCallback(const TimerCallback &callback); 29 | const TimerCallback& getCallback() const; 30 | 31 | Timer& setInterval(const float &interval); 32 | const float getInterval() const; 33 | const float getElapsed() const; 34 | 35 | Timer& reset(); 36 | Timer& start(); 37 | Timer& stop(); 38 | 39 | const bool isRunning() const; 40 | 41 | virtual void update(float dt); 42 | }; 43 | 44 | } // hikari 45 | 46 | #endif // HIKARI_CORE_UTIL_TIMER 47 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/events/AudioEventData.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_AUDIOEVENTDATA 2 | #define HIKARI_CLIENT_AUDIOEVENTDATA 3 | 4 | #include "hikari/client/game/events/BaseEventData.hpp" 5 | 6 | #include 7 | 8 | namespace hikari { 9 | 10 | typedef int SoundType; 11 | 12 | class AudioEventData : public BaseEventData { 13 | public: 14 | static const EventType Type; 15 | static const char * NO_NAME; 16 | 17 | enum AudioAction { 18 | ACTION_PLAY_SAMPLE = 0, 19 | ACTION_STOP_ALL_SAMPLES = 1, 20 | ACTION_PLAY_MUSIC = 2, 21 | ACTION_STOP_MUSIC = 3, 22 | ACTION_MUTE = 4, 23 | ACTION_UNMUTE = 5 24 | }; 25 | 26 | private: 27 | AudioAction action; 28 | std::string name; 29 | 30 | public: 31 | explicit AudioEventData(AudioAction action, const std::string & name = NO_NAME); 32 | virtual ~AudioEventData(); 33 | 34 | AudioAction getAudioAction() const; 35 | const std::string & getMusicOrSampleName() const; 36 | 37 | virtual const EventType & getEventType() const; 38 | 39 | virtual EventDataPtr copy() const; 40 | virtual const char * getName() const; 41 | }; 42 | 43 | } // hikari 44 | 45 | #endif // HIKARI_CLIENT_AUDIOEVENTDATA -------------------------------------------------------------------------------- /engine/include/hikari/core/util/ResourceCache.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CORE_UTIL_RESOURCECACHE 2 | #define HIKARI_CORE_UTIL_RESOURCECACHE 3 | 4 | #include "hikari/core/Platform.hpp" 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace hikari { 13 | 14 | template 15 | class HIKARI_API ResourceCache { 16 | public: 17 | typedef std::shared_ptr Resource; 18 | typedef std::unordered_map ResourceMap; 19 | 20 | virtual ~ResourceCache() { } 21 | 22 | Resource get(const std::string &fileName) { 23 | auto it = resources.find(fileName); 24 | if(it != resources.end()) { 25 | return it->second; 26 | } else { 27 | cacheResource(fileName, loadResource(fileName)); 28 | return get(fileName); 29 | } 30 | } 31 | protected: 32 | virtual Resource loadResource(const std::string &fileName) = 0; 33 | 34 | void cacheResource(const std::string &key, const Resource &resourcePtr) { 35 | resources.insert(std::make_pair(key, resourcePtr)); 36 | } 37 | 38 | private: 39 | ResourceMap resources; 40 | }; 41 | 42 | } // hikari 43 | 44 | #endif // HIKARI_CORE_UTIL_RESOURCECACHE -------------------------------------------------------------------------------- /content/assets/tilesets.json: -------------------------------------------------------------------------------- 1 | { 2 | "test1" : { 3 | "surface" : "assets/images/tileset-dev.png", 4 | "size" : 16, 5 | "tiles" : [ 6 | { "x" : 0, "y" : 0 }, 7 | { "x" : 16, "y" : 0 }, 8 | { "x" : 32, "y" : 0 }, 9 | { "x" : 48, "y" : 0 } 10 | ] 11 | }, 12 | "skull" : { 13 | "surface" : "assets/images/tile-skull.png", 14 | "size" : 16, 15 | "tiles" : [ 16 | { "x" : 0, "y" : 0 }, 17 | { "x" : 0, "y" : 0 }, 18 | { "x" : 16, "y" : 0 }, 19 | { "x" : 32, "y" : 0 }, 20 | { "x" : 48, "y" : 0 }, 21 | { "x" : 0, "y" : 16 }, 22 | { "x" : 16, "y" : 16 }, 23 | { "x" : 32, "y" : 16 }, 24 | { "x" : 48, "y" : 16 }, 25 | { "x" : 0, "y" : 32 }, 26 | { "x" : 16, "y" : 32 }, 27 | { "x" : 32, "y" : 32 }, 28 | { "x" : 48, "y" : 32 }, 29 | { "x" : 0, "y" : 48 }, 30 | { "x" : 16, "y" : 48 }, 31 | { "x" : 32, "y" : 48 }, 32 | { "x" : 48, "y" : 48 }, 33 | { "x" : 0, "y" : 64 }, 34 | { "x" : 16, "y" : 64 }, 35 | { "x" : 32, "y" : 64 }, 36 | { "x" : 48, "y" : 64 }, 37 | { "x" : 0, "y" : 80 }, 38 | { "x" : 16, "y" : 80 }, 39 | { "x" : 32, "y" : 80 }, 40 | { "x" : 48, "y" : 80 }, 41 | { "x" : 0, "y" : 96 }, 42 | { "x" : 16, "y" : 96 }, 43 | { "x" : 32, "y" : 96 }, 44 | { "x" : 48, "y" : 96 }, 45 | { "x" : 0, "y" : 112 }, 46 | { "x" : 16, "y" : 112 } 47 | ] 48 | } 49 | } -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/ParticleFactory.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECT_PARTICLEFACTORY 2 | #define HIKARI_CLIENT_GAME_OBJECT_PARTICLEFACTORY 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "hikari/core/util/Service.hpp" 9 | 10 | namespace hikari { 11 | 12 | class AnimationSetCache; 13 | class ImageCache; 14 | class Particle; 15 | 16 | class ParticleFactory : public Service { 17 | private: 18 | // 19 | // Fields 20 | // 21 | std::weak_ptr animationSetCache; 22 | std::weak_ptr imageCache; 23 | std::unordered_map> prototypeRegistry; 24 | 25 | public: 26 | // 27 | // Constructor 28 | // 29 | ParticleFactory(const std::weak_ptr& animationSetCache, 30 | const std::weak_ptr& imageCache); 31 | virtual ~ParticleFactory(); 32 | 33 | // 34 | // Methods 35 | // 36 | std::unique_ptr create(const std::string& enemyType); 37 | 38 | void registerPrototype(const std::string & prototypeName, const std::shared_ptr & instancee); 39 | }; 40 | 41 | } // hikari 42 | 43 | #endif // HIKARI_CLIENT_GAME_OBJECT_PARTICLEFACTORY -------------------------------------------------------------------------------- /engine/src/hikari/core/util/HashedString.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/core/util/HashedString.hpp" 2 | #include 3 | #include 4 | #include 5 | 6 | namespace hikari { 7 | 8 | std::ostream& operator<<(std::ostream& message, const HashedString& string) { 9 | message << string.getString(); 10 | return message; 11 | } 12 | 13 | HashedString::HashedString(const std::string& string) 14 | : hash(0) 15 | , string(string) { 16 | std::hash hashingFunction; 17 | hash = hashingFunction(string); 18 | } 19 | 20 | HashedString::~HashedString() { } 21 | 22 | bool HashedString::operator<(const HashedString& other) const { 23 | return (getHash() < other.getHash()); 24 | } 25 | 26 | bool HashedString::operator>(const HashedString& other) const { 27 | return (getHash() > other.getHash()); 28 | } 29 | 30 | bool HashedString::operator==(const HashedString& other) const { 31 | return (getHash() == other.getHash()); 32 | } 33 | 34 | bool HashedString::operator!=(const HashedString& other) const { 35 | return (getHash() != other.getHash()); 36 | } 37 | 38 | const std::size_t HashedString::getHash() const { 39 | return hash; 40 | } 41 | 42 | const std::string& HashedString::getString() const { 43 | return string; 44 | } 45 | 46 | } // hikari 47 | -------------------------------------------------------------------------------- /content/assets/scripts/Bootstrap.nut: -------------------------------------------------------------------------------- 1 | require("assets/scripts/EffectBase.nut"); 2 | require("assets/scripts/effects/ExtraLifeEffect.nut"); 3 | require("assets/scripts/effects/AddETankEffect.nut"); 4 | require("assets/scripts/effects/ModifyHealthEffect.nut"); 5 | require("assets/scripts/effects/ModifyWeaponEnergyEffect.nut"); 6 | // Enemies 7 | require("assets/scripts/behaviors/EnemyBehavior.nut"); 8 | require("assets/scripts/behaviors/TellyBehavior.nut"); 9 | require("assets/scripts/behaviors/HammerJoeBehavior.nut"); 10 | require("assets/scripts/behaviors/DadaEnemyBehavior.nut"); 11 | require("assets/scripts/behaviors/MetoolEnemyBehavior.nut"); 12 | require("assets/scripts/behaviors/OctopusBatteryEnemyBehavior.nut"); 13 | require("assets/scripts/behaviors/KomasaburoEnemyBehavior.nut"); 14 | require("assets/scripts/behaviors/BikkyEnemyBehavior.nut"); 15 | require("assets/scripts/behaviors/PeterchyEnemyBehavior.nut"); 16 | require("assets/scripts/behaviors/GroundWalkingBehavior.nut"); 17 | require("assets/scripts/behaviors/SpringerBehavior.nut"); 18 | require("assets/scripts/behaviors/MoleBehavior.nut"); 19 | // Doodads 20 | require("assets/scripts/behaviors/DoodadBehavior.nut"); 21 | require("assets/scripts/behaviors/AppearingBlockBehavior.nut"); 22 | require("assets/scripts/behaviors/MovingPlatformBehavior.nut"); 23 | require("assets/scripts/behaviors/MovingPlatformBehavior.nut"); 24 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/CollectableItem.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_COLLECTABLEITEM 2 | #define HIKARI_CLIENT_GAME_OBJECTS_COLLECTABLEITEM 3 | 4 | #include "hikari/client/game/objects/Entity.hpp" 5 | #include "hikari/core/util/Cloneable.hpp" 6 | #include 7 | // #include 8 | 9 | namespace hikari { 10 | 11 | class AnimationSet; 12 | class Effect; 13 | class ItemSpawner; 14 | 15 | class CollectableItem : public Entity, public Cloneable { 16 | private: 17 | std::shared_ptr effect; 18 | 19 | public: 20 | CollectableItem(int id, std::shared_ptr room, std::shared_ptr effect); 21 | CollectableItem(const CollectableItem &proto); 22 | virtual ~CollectableItem(); 23 | 24 | virtual std::unique_ptr clone() const; 25 | 26 | void setEffect(std::shared_ptr newEffect); 27 | std::shared_ptr getEffect() const; 28 | 29 | virtual void onBirth(); 30 | virtual void onDeath(); 31 | virtual void onWake(); 32 | virtual void onSleep(); 33 | 34 | virtual void update(float dt); 35 | virtual void render(sf::RenderTarget &target); 36 | virtual void reset(); 37 | }; 38 | 39 | } // hikari 40 | 41 | #endif // HIKARI_CLIENT_GAME_OBJECTS_COLLECTABLEITEM -------------------------------------------------------------------------------- /extlibs/squirrel/squirrel/squserdata.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQUSERDATA_H_ 3 | #define _SQUSERDATA_H_ 4 | 5 | struct SQUserData : SQDelegable 6 | { 7 | SQUserData(SQSharedState *ss){ _delegate = 0; _hook = NULL; INIT_CHAIN(); ADD_TO_CHAIN(&_ss(this)->_gc_chain, this); } 8 | ~SQUserData() 9 | { 10 | REMOVE_FROM_CHAIN(&_ss(this)->_gc_chain, this); 11 | SetDelegate(NULL); 12 | } 13 | static SQUserData* Create(SQSharedState *ss, SQInteger size) 14 | { 15 | SQUserData* ud = (SQUserData*)SQ_MALLOC(sq_aligning(sizeof(SQUserData))+size); 16 | new (ud) SQUserData(ss); 17 | ud->_size = size; 18 | ud->_typetag = 0; 19 | return ud; 20 | } 21 | #ifndef NO_GARBAGE_COLLECTOR 22 | void Mark(SQCollectable **chain); 23 | void Finalize(){SetDelegate(NULL);} 24 | SQObjectType GetType(){ return OT_USERDATA;} 25 | #endif 26 | void Release() { 27 | if (_hook) _hook((SQUserPointer)sq_aligning(this + 1),_size); 28 | SQInteger tsize = _size; 29 | this->~SQUserData(); 30 | SQ_FREE(this, sq_aligning(sizeof(SQUserData)) + tsize); 31 | } 32 | 33 | 34 | SQInteger _size; 35 | SQRELEASEHOOK _hook; 36 | SQUserPointer _typetag; 37 | //SQChar _val[1]; 38 | }; 39 | 40 | #endif //_SQUSERDATA_H_ 41 | -------------------------------------------------------------------------------- /engine/include/hikari/client/game/objects/effects/ScriptedEffect.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HIKARI_CLIENT_GAME_OBJECTS_EFFECTS_SCRIPTEDEFFECT 2 | #define HIKARI_CLIENT_GAME_OBJECTS_EFFECTS_SCRIPTEDEFFECT 3 | 4 | #include "hikari/client/game/Effect.hpp" 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | namespace hikari { 12 | 13 | class SquirrelService; 14 | 15 | class ScriptedEffect : public Effect { 16 | private: 17 | static const char * FUNCTION_NAME_APPLY; 18 | static const char * FUNCTION_NAME_UNAPPLY; 19 | static const char * BASE_CLASS_NAME; 20 | 21 | private: 22 | HSQUIRRELVM vm; 23 | std::string effectClassName; 24 | Sqrat::Object instance; 25 | Sqrat::Table config; 26 | Sqrat::Function proxyApply; 27 | Sqrat::Function proxyUnapply; 28 | 29 | bool bindScriptClassInstance(); 30 | 31 | public: 32 | ScriptedEffect(SquirrelService& service, const std::string& effectClassName, const Sqrat::Table& config = Sqrat::Table()); 33 | ScriptedEffect(const ScriptedEffect &proto); 34 | virtual std::shared_ptr clone() const; 35 | virtual ~ScriptedEffect(); 36 | virtual void apply(); 37 | virtual void unapply(); 38 | }; 39 | 40 | } // hikari 41 | 42 | #endif // HIKARI_CLIENT_GAME_OBJECTS_EFFECTS_SCRIPTEDEFFECT -------------------------------------------------------------------------------- /engine/src/hikari/client/scripting/GamePlayStateScriptProxy.cpp: -------------------------------------------------------------------------------- 1 | #include "hikari/client/scripting/GamePlayStateScriptProxy.hpp" 2 | #include "hikari/client/game/GamePlayState.hpp" 3 | 4 | namespace hikari { 5 | 6 | std::weak_ptr GamePlayStateScriptProxy::gamePlayState = std::weak_ptr(); 7 | 8 | GamePlayStateScriptProxy::GamePlayStateScriptProxy() { 9 | // Private to prevent construction 10 | } 11 | 12 | GamePlayStateScriptProxy::GamePlayStateScriptProxy(const GamePlayStateScriptProxy& other) { 13 | // Private to prevent copy construction 14 | } 15 | 16 | std::weak_ptr GamePlayStateScriptProxy::getWrappedService() { 17 | return gamePlayState; 18 | } 19 | 20 | void GamePlayStateScriptProxy::setWrappedService(const std::weak_ptr & gamePlayState) { 21 | GamePlayStateScriptProxy::gamePlayState = gamePlayState; 22 | } 23 | 24 | void GamePlayStateScriptProxy::refillPlayerEnergy(int amount) { 25 | if(const auto & state = gamePlayState.lock()) { 26 | state->refillPlayerEnergy(amount); 27 | } 28 | } 29 | 30 | void GamePlayStateScriptProxy::refillWeaponEnergy(int amount) { 31 | if(const auto & state = gamePlayState.lock()) { 32 | state->refillWeaponEnergy(amount); 33 | } 34 | } 35 | 36 | } // hikari 37 | --------------------------------------------------------------------------------