-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
254 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
{"BASE_CANNON":[{"cost":600,"attack":0},{"cost":1200,"attack":0},{"cost":2400,"attack":0},{"cost":4800,"attack":0},{"cost":9600,"attack":0},{"cost":19200,"attack":0},{"cost":0,"attack":0}],"BASE_DEFENSE":[{"cost":600,"defense":10000},{"cost":1200,"defense":15000},{"cost":2400,"defense":20000},{"cost":4800,"defense":30000},{"cost":9600,"defense":50000},{"cost":19200,"defense":70000},{"cost":0,"defense":100000}],"BUILD_TIME":[{"cost":700,"multiplier":1},{"cost":1400,"multiplier":0.96},{"cost":2800,"multiplier":0.92},{"cost":5600,"multiplier":0.88},{"cost":11200,"multiplier":0.84},{"cost":22400,"multiplier":0.8},{"cost":44800,"multiplier":0.76},{"cost":89600,"multiplier":0.72},{"cost":179200,"multiplier":0.68},{"cost":0,"multiplier":0.64}],"CR_RESEARCH":[{"cost":500,"multiplier":1},{"cost":1000,"multiplier":1.2},{"cost":2000,"multiplier":1.4},{"cost":4000,"multiplier":1.6},{"cost":8000,"multiplier":1.8},{"cost":16000,"multiplier":2},{"cost":32000,"multiplier":2.2},{"cost":64000,"multiplier":2.4},{"cost":128000,"multiplier":2.7},{"cost":0,"multiplier":3}],"CELL_RESEARCH":[{"cost":800,"multiplier":1},{"cost":1600,"multiplier":1.1},{"cost":3200,"multiplier":1.2},{"cost":6400,"multiplier":1.3},{"cost":12800,"multiplier":1.4},{"cost":25600,"multiplier":1.5},{"cost":51200,"multiplier":1.6},{"cost":102400,"multiplier":1.8},{"cost":204800,"multiplier":2},{"cost":0,"multiplier":2.2}],"CELL_STORAGE":[{"cost":700,"storage":500},{"cost":1400,"storage":700},{"cost":2800,"storage":1000},{"cost":5600,"storage":1400},{"cost":11200,"storage":1800},{"cost":22400,"storage":2300},{"cost":44800,"storage":2900},{"cost":89600,"storage":3400},{"cost":179200,"storage":4000},{"cost":0,"storage":4700}]} | ||
{"BASE_CANNON":[ | ||
{"cost":600,"attack":0, | ||
"reload": 2.5,"shell_count": 10, "shot_delay": 0.16, "bullet_speed": 1, "spread": 1.0 | ||
}, | ||
{"cost":1200,"attack":0,"reload": 2.4,"shell_count": 12, "shot_delay": 0.15, "bullet_speed": 1, "spread": 0.95}, | ||
{"cost":2400,"attack":0,"reload": 2.3,"shell_count": 14, "shot_delay": 0.14, "bullet_speed": 1, "spread": 0.90}, | ||
{"cost":4800,"attack":0,"reload": 2.2,"shell_count": 16, "shot_delay": 0.13, "bullet_speed": 1, "spread": 0.85}, | ||
{"cost":9600,"attack":0,"reload": 2.1,"shell_count": 18, "shot_delay": 0.12, "bullet_speed": 1, "spread": 0.80}, | ||
{"cost":19200,"attack":0,"reload": 2.0,"shell_count": 20, "shot_delay": 0.11, "bullet_speed": 1, "spread": 0.75}, | ||
{"cost":0,"attack":0,"reload": 1.9,"shell_count": 24, "shot_delay": 0.10, "bullet_speed": 1, "spread": 0.70} | ||
], | ||
|
||
|
||
"BASE_DEFENSE":[{"cost":600,"defense":10000},{"cost":1200,"defense":15000},{"cost":2400,"defense":20000},{"cost":4800,"defense":30000},{"cost":9600,"defense":50000},{"cost":19200,"defense":70000},{"cost":0,"defense":100000}],"BUILD_TIME":[{"cost":700,"multiplier":1},{"cost":1400,"multiplier":0.96},{"cost":2800,"multiplier":0.92},{"cost":5600,"multiplier":0.88},{"cost":11200,"multiplier":0.84},{"cost":22400,"multiplier":0.8},{"cost":44800,"multiplier":0.76},{"cost":89600,"multiplier":0.72},{"cost":179200,"multiplier":0.68},{"cost":0,"multiplier":0.64}],"CR_RESEARCH":[{"cost":500,"multiplier":1},{"cost":1000,"multiplier":1.2},{"cost":2000,"multiplier":1.4},{"cost":4000,"multiplier":1.6},{"cost":8000,"multiplier":1.8},{"cost":16000,"multiplier":2},{"cost":32000,"multiplier":2.2},{"cost":64000,"multiplier":2.4},{"cost":128000,"multiplier":2.7},{"cost":0,"multiplier":3}],"CELL_RESEARCH":[{"cost":800,"multiplier":1},{"cost":1600,"multiplier":1.1},{"cost":3200,"multiplier":1.2},{"cost":6400,"multiplier":1.3},{"cost":12800,"multiplier":1.4},{"cost":25600,"multiplier":1.5},{"cost":51200,"multiplier":1.6},{"cost":102400,"multiplier":1.8},{"cost":204800,"multiplier":2},{"cost":0,"multiplier":2.2}],"CELL_STORAGE":[{"cost":700,"storage":500},{"cost":1400,"storage":700},{"cost":2800,"storage":1000},{"cost":5600,"storage":1400},{"cost":11200,"storage":1800},{"cost":22400,"storage":2300},{"cost":44800,"storage":2900},{"cost":89600,"storage":3400},{"cost":179200,"storage":4000},{"cost":0,"storage":4700}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package fr.mesabloo.heavymachdefense.data | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
abstract class Slot | ||
|
||
@Serializable | ||
data class MachineSlot(val kind: MachineKind) : Slot() | ||
|
||
@Serializable | ||
data class TurretSlot(val kind: TurretKind) : Slot() |
36 changes: 36 additions & 0 deletions
36
core/src/kotlin/fr/mesabloo/heavymachdefense/entities/Bases.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package fr.mesabloo.heavymachdefense.entities | ||
|
||
import com.badlogic.gdx.physics.box2d.BodyDef | ||
import fr.mesabloo.heavymachdefense.PPM | ||
import fr.mesabloo.heavymachdefense.data.GameSave | ||
import fr.mesabloo.heavymachdefense.data.UpgradeKind | ||
import fr.mesabloo.heavymachdefense.data.Upgrades | ||
import fr.mesabloo.heavymachdefense.ui.stage.game.AllyBase | ||
import fr.mesabloo.heavymachdefense.ui.stage.game.EnemyBase | ||
import fr.mesabloo.heavymachdefense.world.GameWorld | ||
import ktx.box2d.body | ||
import ktx.box2d.box | ||
import kotlin.reflect.KProperty0 | ||
|
||
fun createBases(world: GameWorld, upgrades: Upgrades, save: KProperty0<GameSave>) { | ||
world.world.body { | ||
type = BodyDef.BodyType.StaticBody | ||
box(width = 256f / PPM, height = 128f / PPM) { | ||
density = 10000000f | ||
isSensor = true | ||
} | ||
userData = AllyBase(save.get().mainUpgrades[UpgradeKind.BASE_DEFENSE]?.minus(1) ?: 0) | ||
|
||
position.set(512f / 2f / PPM, (128f / 2f + 16f) / PPM) | ||
} | ||
world.world.body { | ||
type = BodyDef.BodyType.StaticBody | ||
box(width = 256f / PPM, height = 128f / PPM) { | ||
density = 10000000f | ||
isSensor = true | ||
} | ||
userData = EnemyBase() | ||
|
||
position.set(512f / 2f / PPM, (2048f - 128f / 2f + 8f) / PPM) | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
core/src/kotlin/fr/mesabloo/heavymachdefense/entities/Terrain.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package fr.mesabloo.heavymachdefense.entities | ||
|
||
import com.badlogic.gdx.physics.box2d.BodyDef | ||
import fr.mesabloo.heavymachdefense.BG_BORDER | ||
import fr.mesabloo.heavymachdefense.PPM | ||
import fr.mesabloo.heavymachdefense.world.GameWorld | ||
import ktx.box2d.body | ||
import ktx.box2d.box | ||
import ktx.math.vec2 | ||
|
||
fun createTerrainBody(world: GameWorld) { | ||
val width = 512f / PPM | ||
val height = 2048f / PPM | ||
|
||
world.world.body { | ||
type = BodyDef.BodyType.StaticBody | ||
box(width, height, position = vec2(width / 2f, height / 2f)) { | ||
isSensor = false | ||
userData = BG_BORDER | ||
} | ||
|
||
//position.set(-512f / PPM, -2048f / PPM) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.