Skip to content

Commit

Permalink
Rename base entity configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jobe-m committed Aug 1, 2024
1 parent 2dc020c commit 8616d93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import korlibs.korge.fleks.entity.*
import korlibs.korge.fleks.entity.EntityFactory.EntityConfig
import korlibs.korge.fleks.tags.*
import korlibs.korge.fleks.utils.random
import kotlinx.serialization.Serializable
import kotlinx.serialization.*


/**
* Function to generate effect objects like explosions, shoots, dust, etc.
*
*/
@Serializable
data class FireAndDustEffect(
@Serializable @SerialName("FireAndDustEffectConfig")
data class FireAndDustEffectConfig(
override val name: String,

private val assetName: String,
Expand All @@ -39,7 +39,7 @@ data class FireAndDustEffect(
// Configure function which applies the config to the entity's components
override fun World.entityConfigure(entity: Entity) : Entity {
entity.configure {
it += InfoComponent(name = this@FireAndDustEffect.name)
it += InfoComponent(name = this@FireAndDustEffectConfig.name)

var velocityXX = velocityX
var velocityYY = velocityY
Expand Down Expand Up @@ -75,7 +75,7 @@ data class FireAndDustEffect(
}
}
it += renderLayerTag
if (layerIndex != null) it += LayerComponent(layerIndex = this@FireAndDustEffect.layerIndex)
if (layerIndex != null) it += LayerComponent(layerIndex = this@FireAndDustEffectConfig.layerIndex)
// entity += RenderLayerTag.DEBUG
}
return entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import korlibs.korge.fleks.components.*
import korlibs.korge.fleks.utils.random
import korlibs.korge.fleks.entity.*
import korlibs.korge.fleks.entity.EntityFactory.EntityConfig
import kotlinx.serialization.Serializable
import kotlinx.serialization.*


/**
* This object prototype can be used to create objects which are moving and spawn a trail.
*
*/
@Serializable
data class MovedSpawnerObject(
@Serializable @SerialName("MovedSpawnerObjectConfig")
data class MovedSpawnerObjectConfig(
override val name: String,

// SpawnerComponent for creating the fire trail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import korlibs.korge.fleks.utils.*
import kotlinx.serialization.*


@Serializable @SerialName("RichText")
@Serializable @SerialName("RichTextConfig")
data class RichTextConfig(
override val name: String,

Expand Down

0 comments on commit 8616d93

Please sign in to comment.