Skip to content

Commit

Permalink
enh: Make Enemy::coinCount abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
piiertho committed Oct 7, 2024
1 parent 31c6aab commit c028247
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion demo/Enemies/BeeBot.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ detection_area = NodePath("PlayerDetectionArea")
death_mesh_collider = NodePath("DeathMeshCollider")
bee_root = NodePath("MeshRoot/bee_root")
defeat_sound = NodePath("DefeatSound")
coins_count = 7

[node name="ReactionLabel" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.23854, 0)
Expand Down
4 changes: 4 additions & 0 deletions demo/Enemies/Beebot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ import godot.extensions.loadAs
@RegisterClass
class Beebot : Enemy() {

@Export
@RegisterProperty
override var coinsCount = 7

@Export
@RegisterProperty
var shootTimer = 1.5
Expand Down
4 changes: 4 additions & 0 deletions demo/Enemies/Beetle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ import shared.Damageable
@RegisterClass
class Beetle : Enemy() {

@Export
@RegisterProperty
override var coinsCount = 5

@Export
@RegisterProperty
var shootTimer = 1.5
Expand Down
2 changes: 1 addition & 1 deletion demo/Enemies/Enemy.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import shared.Damageable
abstract class Enemy : RigidBody3D(), Damageable {
@Export
@RegisterProperty
var coinsCount = 5
abstract var coinsCount: Int

private val puffScene = ResourceLoader.loadAs<PackedScene>("res://demo/Enemies/smoke_puff/smoke_puff.tscn")!!
private val coinScene = ResourceLoader.loadAs<PackedScene>("res://demo/Player/Coin/Coin.tscn")!!
Expand Down

0 comments on commit c028247

Please sign in to comment.