From ad29a81cb8e4afc766bba6aadfa4e288790e7b66 Mon Sep 17 00:00:00 2001 From: Srikavin Ramkumar Date: Thu, 9 Jan 2020 14:17:24 -0500 Subject: [PATCH] Add enemies --- core/assets/assets | 2 +- core/src/me/srikavin/fbla/game/FBLAGame.kt | 67 +++++++++++----- .../fbla/game/dialogue/DialogueManager.kt | 8 +- .../game/dialogue/callable/DialogueAnimal.kt | 78 ++++++++++++++++++ .../game/dialogue/callable/DialogueBlog.kt | 79 +++++++++++++++++++ .../dialogue/callable/DialogueBrochure.kt | 79 +++++++++++++++++++ .../dialogue/callable/DialogueSocialMedia.kt | 78 ++++++++++++++++++ .../fbla/game/ecs/component/SpawnPoint.kt | 12 +++ .../fbla/game/ecs/system/TriggerSystem.kt | 4 + .../me/srikavin/fbla/game/map/MapLoader.kt | 20 +---- .../fbla/game/trigger/DamageTriggerHandler.kt | 51 ++++++++++++ .../fbla/game/trigger/TriggerManager.kt | 2 + .../srikavin/fbla/game/trigger/TriggerType.kt | 3 +- 13 files changed, 441 insertions(+), 42 deletions(-) create mode 100644 core/src/me/srikavin/fbla/game/dialogue/callable/DialogueAnimal.kt create mode 100644 core/src/me/srikavin/fbla/game/dialogue/callable/DialogueBlog.kt create mode 100644 core/src/me/srikavin/fbla/game/dialogue/callable/DialogueBrochure.kt create mode 100644 core/src/me/srikavin/fbla/game/dialogue/callable/DialogueSocialMedia.kt create mode 100644 core/src/me/srikavin/fbla/game/ecs/component/SpawnPoint.kt create mode 100644 core/src/me/srikavin/fbla/game/trigger/DamageTriggerHandler.kt diff --git a/core/assets/assets b/core/assets/assets index 49e787c..542b62e 160000 --- a/core/assets/assets +++ b/core/assets/assets @@ -1 +1 @@ -Subproject commit 49e787cab8eb0fc4074a9be372cdaa4fc5959ec5 +Subproject commit 542b62eee565a0e6a00d4bf576f10a530d6c59f7 diff --git a/core/src/me/srikavin/fbla/game/FBLAGame.kt b/core/src/me/srikavin/fbla/game/FBLAGame.kt index f7750a3..fc0a778 100644 --- a/core/src/me/srikavin/fbla/game/FBLAGame.kt +++ b/core/src/me/srikavin/fbla/game/FBLAGame.kt @@ -6,6 +6,7 @@ import com.artemis.managers.TagManager import com.badlogic.gdx.ApplicationAdapter import com.badlogic.gdx.Gdx import com.badlogic.gdx.assets.AssetManager +import com.badlogic.gdx.assets.loaders.FileHandleResolver import com.badlogic.gdx.assets.loaders.SkinLoader import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver import com.badlogic.gdx.graphics.GL20 @@ -15,6 +16,8 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.TextureRegion import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator +import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader +import com.badlogic.gdx.graphics.g2d.freetype.FreetypeFontLoader import com.badlogic.gdx.maps.tiled.TiledMap import com.badlogic.gdx.maps.tiled.TmxMapLoader import com.badlogic.gdx.math.Vector2 @@ -25,6 +28,7 @@ import com.badlogic.gdx.utils.ObjectMap import com.badlogic.gdx.utils.viewport.ExtendViewport import com.badlogic.gdx.utils.viewport.FitViewport import ktx.actors.onClick +import ktx.assets.disposeSafely import me.srikavin.fbla.game.Scene.PLAYING import me.srikavin.fbla.game.Scene.TITLE import me.srikavin.fbla.game.ecs.system.* @@ -35,7 +39,8 @@ const val cameraScale = 45f enum class Scene { PLAYING, - TITLE + TITLE, + LOADING } class FBLAGame : ApplicationAdapter() { @@ -43,8 +48,10 @@ class FBLAGame : ApplicationAdapter() { lateinit var world: World lateinit var batch: SpriteBatch lateinit var skin: Skin + var assetManager = AssetManager() + lateinit var splashImage: Texture - var scene: Scene = TITLE + private var scene: Scene = Scene.LOADING override fun resize(width: Int, height: Int) { if (scene == PLAYING) { @@ -53,7 +60,7 @@ class FBLAGame : ApplicationAdapter() { camera.zoom = 1f camera.update() - } else { + } else if (scene == TITLE) { stageBg.viewport.update(width, height) } } @@ -64,7 +71,6 @@ class FBLAGame : ApplicationAdapter() { camera.position.y = cameraScale * (9f / 16f) * 0.75f val physicsWorld = com.badlogic.gdx.physics.box2d.World(Vector2(0f, -23f), true) - batch = SpriteBatch() val stage = Stage(ExtendViewport(640f, 480f)) val root = Table(skin) @@ -108,29 +114,40 @@ class FBLAGame : ApplicationAdapter() { .register(listenerManager) world = World(config) - mapLoader.loadMap(world, "assets/maps/level2.tmx") + mapLoader.loadMap(world, "assets/maps/level1.tmx") } private lateinit var titleBg: TextureRegion private lateinit var stageBg: Stage override fun create() { - val assetManager = AssetManager() - assetManager.setLoader(TiledMap::class.java, TmxMapLoader(InternalFileHandleResolver())) + batch = SpriteBatch() + splashImage = Texture(Gdx.files.internal("assets/graphics/titlelogo.png")) + + // Load necessary resources asynchronously + val resolver: FileHandleResolver = InternalFileHandleResolver() + assetManager.setLoader(TiledMap::class.java, TmxMapLoader(resolver)) + assetManager.setLoader(FreeTypeFontGenerator::class.java, FreeTypeFontGeneratorLoader(resolver)) + assetManager.setLoader(BitmapFont::class.java, ".ttf", FreetypeFontLoader(resolver)) - val generator = FreeTypeFontGenerator(Gdx.files.internal("assets/fonts/Kenney Pixel.ttf")) - val parameter = FreeTypeFontGenerator.FreeTypeFontParameter() - parameter.size = 48 - val font12: BitmapFont = generator.generateFont(parameter) + val parameter = FreetypeFontLoader.FreeTypeFontLoaderParameter() + parameter.fontParameters.size = 48 + parameter.fontFileName = "assets/fonts/Kenney Pixel.ttf" + assetManager.load("KenneyPixel48.ttf", BitmapFont::class.java, parameter) + val font = assetManager.finishLoadingAsset("KenneyPixel48.ttf") val fontMap = ObjectMap() - fontMap.put("KenneyPixel", font12) - generator.dispose() + fontMap.put("KenneyPixel", font) assetManager.load("assets/skin/skin.json", Skin::class.java, SkinLoader.SkinParameter(fontMap)) - assetManager.finishLoading() + } + + fun afterLoad() { skin = assetManager.get("assets/skin/skin.json") + skin.add("KenneyPixel", assetManager.get("KenneyPixel48.ttf")) + } + fun initTitleScreen() { camera = OrthographicCamera(cameraScale, cameraScale * (9f / 16f)) titleBg = TextureRegion(Texture(Gdx.files.internal("assets/graphics/homescreen.png"))) @@ -198,7 +215,6 @@ class FBLAGame : ApplicationAdapter() { vertGroup.addActor(instructions) vertGroup.addActor(exit) Gdx.input.inputProcessor = stageBg - scene = TITLE } @@ -210,19 +226,30 @@ class FBLAGame : ApplicationAdapter() { } TITLE -> { Gdx.gl.glClearColor(0f, 0f, 0f, 1f) - Gdx.gl.glClear( - GL20.GL_COLOR_BUFFER_BIT - or GL20.GL_DEPTH_BUFFER_BIT - or (if (Gdx.graphics.bufferFormat.coverageSampling) GL20.GL_COVERAGE_BUFFER_BIT_NV else 0) - ) + Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT or GL20.GL_DEPTH_BUFFER_BIT) stageBg.act() stageBg.draw() } + Scene.LOADING -> { + // Render splash image + Gdx.gl.glClearColor(20f, 20f, 20f, 1f) + Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT or GL20.GL_DEPTH_BUFFER_BIT) + batch.begin() + batch.draw(splashImage, (Gdx.graphics.width / 2f) - 128f, (Gdx.graphics.height / 2f) - 182f, + 256f, 264f) + batch.end() + // Continue loading resources + if (assetManager.update()) { + afterLoad() + initTitleScreen() + } + } } } override fun dispose() { + assetManager.disposeSafely() world.dispose() } } diff --git a/core/src/me/srikavin/fbla/game/dialogue/DialogueManager.kt b/core/src/me/srikavin/fbla/game/dialogue/DialogueManager.kt index 3a7d894..847a68a 100644 --- a/core/src/me/srikavin/fbla/game/dialogue/DialogueManager.kt +++ b/core/src/me/srikavin/fbla/game/dialogue/DialogueManager.kt @@ -36,11 +36,15 @@ class DialogueManager(private val stage: Stage, skin: Skin) { "job_interview" to DialogueJobInterview(), "speech" to DialogueSpeech(), "letter_rec" to DialogueLetterRec(), - "fbla_knowledge" to QuizFBLAKnowledge() + "fbla_knowledge" to QuizFBLAKnowledge(), + "animal" to DialogueAnimal(), + "brochure" to DialogueBrochure(), + "social_media" to DialogueSocialMedia(), + "blog" to DialogueBlog() ) /** - * Gets the [DialogueCallable] associated with the given name + * Gets the [DialogueCallable] associated with a given name * * @param name The name of the Dialogue Callable to lookup */ diff --git a/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueAnimal.kt b/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueAnimal.kt new file mode 100644 index 0000000..204a5be --- /dev/null +++ b/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueAnimal.kt @@ -0,0 +1,78 @@ +package me.srikavin.fbla.game.dialogue.callable + +import me.srikavin.fbla.game.dialogue.DialogueCallable + +class DialogueAnimal : DialogueCallable() { + + override fun run() { + say("Do you like animals?") + var index = getResponse(listOf("Kind of", "They're lovely", "I hate them")) + + if (index == 0) { + updateScore(0) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + say("How much experience do you have with them?") + index = getResponse(listOf("Enough", "None")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(-1) + } + + say("Why do you want to work with them?") + index = getResponse(listOf("It's a passion of mine", "To further my progress in my award.", "No clue, I was told to show up here")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(0) + } + if (index == 2) { + updateScore(-1) + } + + say("Which animals would you like to work with?") + index = getResponse(listOf("Cats", "Dogs", "Horses")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(1) + } + + say("Hope you have fun!") + index = getResponse(listOf("Sure", "I will!", "I wish I would.")) + + if (index == 0) { + updateScore(0) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + + val score = getScore() + if (score > 0) { + say("You've completed your volunteering!") + } + if (score <= 0) { + say("They kicked you out.") + } + } +} diff --git a/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueBlog.kt b/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueBlog.kt new file mode 100644 index 0000000..80c586c --- /dev/null +++ b/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueBlog.kt @@ -0,0 +1,79 @@ +package me.srikavin.fbla.game.dialogue.callable + +import me.srikavin.fbla.game.dialogue.DialogueCallable + +class DialogueBlog : DialogueCallable() { + + override fun run() { + say("Title?") + var index = getResponse(listOf("The adventures of FBLA", "Business Achievement Award ultimate guide", "Funny blog")) + + if (index == 0) { + updateScore(0) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + say("Format?") + index = getResponse(listOf("Organized", "Thrown Together")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(-1) + } + + say("Topic?") + index = getResponse(listOf("BAA Award", "Every-day life of FBLA president", "Memes")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(0) + } + if (index == 2) { + updateScore(-1) + } + + say("Color scheme?") + index = getResponse(listOf("Green and purple", "Gold and blue", "Orange and yellow")) + + if (index == 0) { + updateScore(-1) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + say("Ads?") + index = getResponse(listOf("Sometimes", "No", "Yes")) + + if (index == 0) { + updateScore(0) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + + val score = getScore() + if (score > 0) { + say("You've successfully created a blog!") + } + if (score <= 0) { + say("Time to start over!") + } + } +} diff --git a/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueBrochure.kt b/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueBrochure.kt new file mode 100644 index 0000000..a547cf1 --- /dev/null +++ b/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueBrochure.kt @@ -0,0 +1,79 @@ +package me.srikavin.fbla.game.dialogue.callable + +import me.srikavin.fbla.game.dialogue.DialogueCallable + +class DialogueBrochure : DialogueCallable() { + + override fun run() { + say("Title?") + var index = getResponse(listOf("FBLA", "Business Achievement Award", "None")) + + if (index == 0) { + updateScore(0) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + say("Format?") + index = getResponse(listOf("Organized", "Thrown Together")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(-1) + } + + say("Topic?") + index = getResponse(listOf("BAA Award", "How-to invest", "Memes")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(0) + } + if (index == 2) { + updateScore(-1) + } + + say("Color scheme?") + index = getResponse(listOf("Green and purple", "Gold and blue", "Black and white")) + + if (index == 0) { + updateScore(-1) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + say("Style?") + index = getResponse(listOf("Bi-fold", "Trifold", "Single sheet")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + + val score = getScore() + if (score > 0) { + say("You've successfully created a social brochure!") + } + if (score <= 0) { + say("Back to the drawing board") + } + } +} diff --git a/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueSocialMedia.kt b/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueSocialMedia.kt new file mode 100644 index 0000000..015e313 --- /dev/null +++ b/core/src/me/srikavin/fbla/game/dialogue/callable/DialogueSocialMedia.kt @@ -0,0 +1,78 @@ +package me.srikavin.fbla.game.dialogue.callable + +import me.srikavin.fbla.game.dialogue.DialogueCallable + +class DialogueSocialMedia : DialogueCallable() { + + override fun run() { + say("Title?") + var index = getResponse(listOf("Club", "FBLA", "None")) + + if (index == 0) { + updateScore(0) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + say("Format?") + index = getResponse(listOf("Organized", "Thrown Together")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(-1) + } + + say("Topic?") + index = getResponse(listOf("BAA Award", "Club in general", "Cute dogs")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(0) + } + if (index == 2) { + updateScore(-1) + } + say("Color scheme?") + index = getResponse(listOf("Red, blue, white", "Gold and blue", "Black and white")) + + if (index == 0) { + updateScore(0) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + say("Platform?") + index = getResponse(listOf("Instagram", "Facebook", "MySpace")) + + if (index == 0) { + updateScore(1) + } + if (index == 1) { + updateScore(1) + } + if (index == 2) { + updateScore(-1) + } + + + val score = getScore() + if (score > 0) { + say("You've successfully created a social media post!") + } + if (score <= 0) { + say("Back to the drawing board") + } + } +} diff --git a/core/src/me/srikavin/fbla/game/ecs/component/SpawnPoint.kt b/core/src/me/srikavin/fbla/game/ecs/component/SpawnPoint.kt new file mode 100644 index 0000000..2eff1ba --- /dev/null +++ b/core/src/me/srikavin/fbla/game/ecs/component/SpawnPoint.kt @@ -0,0 +1,12 @@ +package me.srikavin.fbla.game.ecs.component + +import com.artemis.Component +import com.badlogic.gdx.math.Vector2 + +class SpawnPoint() : Component() { + var position: Vector2 = Vector2() + + constructor(position: Vector2) : this() { + this.position = position + } +} \ No newline at end of file diff --git a/core/src/me/srikavin/fbla/game/ecs/system/TriggerSystem.kt b/core/src/me/srikavin/fbla/game/ecs/system/TriggerSystem.kt index cbe72a2..7227caf 100644 --- a/core/src/me/srikavin/fbla/game/ecs/system/TriggerSystem.kt +++ b/core/src/me/srikavin/fbla/game/ecs/system/TriggerSystem.kt @@ -22,6 +22,10 @@ class TriggerSystem(private val listenerManager: ContactListenerManager) : BaseE private val triggerManager = TriggerManager() private val collisions: MutableSet = HashSet() + fun removePlayerFromCollision(player: EntityInt) { + collisions.removeIf { it.player == player } + } + inner class CollisionListener : ContactListener { override fun endContact(contact: Contact) { val playerId = world.getSystem(TagManager::class.java).getEntityId("PLAYER") diff --git a/core/src/me/srikavin/fbla/game/map/MapLoader.kt b/core/src/me/srikavin/fbla/game/map/MapLoader.kt index 4266e16..26872b5 100644 --- a/core/src/me/srikavin/fbla/game/map/MapLoader.kt +++ b/core/src/me/srikavin/fbla/game/map/MapLoader.kt @@ -71,7 +71,7 @@ class MapLoader { /** * Creates a player entity with the given world and given position */ - private fun createPlayer(world: World, pos: Vector2) { + fun createPlayer(world: World, pos: Vector2) { world.getSystem(CameraFollowSystem::class.java).camera.position.y = pos.y + 5 val e = world.createEntity().edit() @@ -88,6 +88,7 @@ class MapLoader { .add(Transform().apply { position = pos }) .add(SwitchableAnimation().apply { animations = playerAnimations; currentState = "Stand" }) .add(FixedRotation()) + .add(SpawnPoint(pos.cpy())) .entity world.getSystem(TagManager::class.java).register("PLAYER", e) @@ -196,23 +197,6 @@ class MapLoader { properties = mapObject.properties }) } - type == "damage" -> { -// val rect = mapObject.rectangle - -// world.createEntity().edit() -// .add(Transform().apply { position = rect.getCenter(recycledVector2).scl(MAP_SCALE_FACTOR).cpy() }) -// .add(PhysicsBody().apply { -// shape = PolygonShape().apply { -// setAsBox(rect.width * MAP_SCALE_FACTOR * .5f, rect.height * MAP_SCALE_FACTOR * .5f, -// recycledVector2.setZero(), 0f) -// } -// this.type = BodyDef.BodyType.StaticBody -// }) -// .add(MapTrigger().apply { -// this.type = TriggerType.valueOf(type.toUpperCase()) -// properties = mapObject.properties -// }) - } else -> { customTriggerProcessor(mapObject, type, path) } diff --git a/core/src/me/srikavin/fbla/game/trigger/DamageTriggerHandler.kt b/core/src/me/srikavin/fbla/game/trigger/DamageTriggerHandler.kt new file mode 100644 index 0000000..34bf8d2 --- /dev/null +++ b/core/src/me/srikavin/fbla/game/trigger/DamageTriggerHandler.kt @@ -0,0 +1,51 @@ +package me.srikavin.fbla.game.trigger + +import com.artemis.World +import com.badlogic.gdx.math.Vector2 +import com.badlogic.gdx.utils.TimeUtils +import me.srikavin.fbla.game.EntityInt +import me.srikavin.fbla.game.GameState +import me.srikavin.fbla.game.ecs.component.MapTrigger +import me.srikavin.fbla.game.ecs.component.PhysicsBody +import me.srikavin.fbla.game.ecs.component.SpawnPoint +import me.srikavin.fbla.game.ecs.component.Transform +import me.srikavin.fbla.game.ecs.system.TriggerSystem +import me.srikavin.fbla.game.map.MapLoader + +private const val INVULNERABLE_TIME_MSEC: Long = 500 + +/** + * Handles triggers resulting from player collision with coins. + */ +class DamageTriggerHandler : TriggerHandler { + private val knockbackImpulse = Vector2(-30f, 35f) + private var lastDamageTime = 0L + + override fun run(world: World, player: EntityInt, triggerEntity: EntityInt, trigger: MapTrigger) { + if (lastDamageTime + INVULNERABLE_TIME_MSEC > TimeUtils.millis()) { + return + } + + val gameState = world.getRegistered(GameState::class.java) + val physicsMapper = world.getMapper(PhysicsBody::class.java) + val transformMapper = world.getMapper(Transform::class.java) + + gameState.lives -= 1 + + lastDamageTime = TimeUtils.millis() + if (physicsMapper.has(player) && transformMapper.has(player)) { + physicsMapper[player].body.applyLinearImpulse(knockbackImpulse, transformMapper[player].position, true) + } + + if (gameState.lives <= 0) { + val spawnPointMapper = world.getMapper(SpawnPoint::class.java) + if (spawnPointMapper.has(player) && physicsMapper.has(player)) { + val spawnPoint = spawnPointMapper[player].position.cpy() + world.delete(player) + world.getRegistered(MapLoader::class.java).createPlayer(world, spawnPoint) + world.getSystem(TriggerSystem::class.java).removePlayerFromCollision(player) + gameState.lives = 3 + } + } + } +} \ No newline at end of file diff --git a/core/src/me/srikavin/fbla/game/trigger/TriggerManager.kt b/core/src/me/srikavin/fbla/game/trigger/TriggerManager.kt index 75212b8..d4a139e 100644 --- a/core/src/me/srikavin/fbla/game/trigger/TriggerManager.kt +++ b/core/src/me/srikavin/fbla/game/trigger/TriggerManager.kt @@ -12,6 +12,7 @@ class TriggerManager { private val transitionTriggerHandler = TransitionTriggerHandler() private val interactiveTriggerHandler = InteractiveTriggerHandler() private val minigameTriggerHandler = MinigameTriggerHandler() + private val damageTriggerHandler = DamageTriggerHandler() fun handle(world: World, player: EntityInt, triggerEntity: EntityInt, trigger: MapTrigger) { when (trigger.type) { @@ -19,6 +20,7 @@ class TriggerManager { TriggerType.TRANSITION -> transitionTriggerHandler.run(world, player, triggerEntity, trigger) TriggerType.INTERACTIVE -> interactiveTriggerHandler.run(world, player, triggerEntity, trigger) TriggerType.MINIGAME -> minigameTriggerHandler.run(world, player, triggerEntity, trigger) + TriggerType.DAMAGE -> damageTriggerHandler.run(world, player, triggerEntity, trigger) } } } \ No newline at end of file diff --git a/core/src/me/srikavin/fbla/game/trigger/TriggerType.kt b/core/src/me/srikavin/fbla/game/trigger/TriggerType.kt index ebe0440..c7c4513 100644 --- a/core/src/me/srikavin/fbla/game/trigger/TriggerType.kt +++ b/core/src/me/srikavin/fbla/game/trigger/TriggerType.kt @@ -7,5 +7,6 @@ enum class TriggerType { COIN, TRANSITION, INTERACTIVE, - MINIGAME + MINIGAME, + DAMAGE } \ No newline at end of file