Skip to content

Commit

Permalink
Merge branch 'main' into feature/metricsUI
Browse files Browse the repository at this point in the history
  • Loading branch information
sp4ce-cowboy authored Apr 20, 2024
2 parents 18d7157 + 2725e4a commit 318813e
Show file tree
Hide file tree
Showing 55 changed files with 526 additions and 187 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "damage.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "damage 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "damage 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "nocost.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "nocost 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "nocost 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "soldier-frame.png",
"filename" : "wizard-frame.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 28 additions & 4 deletions TowerForge/TowerForge.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@
3CAC4A752BB6BDD500A5D22E /* HealthRenderStage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CAC4A742BB6BDD500A5D22E /* HealthRenderStage.swift */; };
3CBE72F92BC8D63500CC446A /* RemoteKillEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBE72F82BC8D63500CC446A /* RemoteKillEvent.swift */; };
3CBE72FB2BC8D63E00CC446A /* RemoteDamageEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBE72FA2BC8D63E00CC446A /* RemoteDamageEvent.swift */; };
3CBE72FD2BC8D64F00CC446A /* RemoteMoveEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBE72FC2BC8D64F00CC446A /* RemoteMoveEvent.swift */; };
3CBE72FD2BC8D64F00CC446A /* RemoteSyncPositionEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBE72FC2BC8D64F00CC446A /* RemoteSyncPositionEvent.swift */; };
3CBE72FF2BC8D66C00CC446A /* RemotePowerupEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBE72FE2BC8D66C00CC446A /* RemotePowerupEvent.swift */; };
3CBE73012BC8D69A00CC446A /* RemoteLifeEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBE73002BC8D69A00CC446A /* RemoteLifeEvent.swift */; };
3CBECF892BBE9797005EF39B /* TFNetworkCoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBECF882BBE9797005EF39B /* TFNetworkCoder.swift */; };
3CBECF8C2BBE9A41005EF39B /* TFRemoteEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBECF8B2BBE9A41005EF39B /* TFRemoteEvent.swift */; };
3CBECF8E2BBE9EAC005EF39B /* RemoteSpawnEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CBECF8D2BBE9EAC005EF39B /* RemoteSpawnEvent.swift */; };
3CCA1EEE2BD247E8009302F8 /* RemoteRemovePowerupEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CCA1EED2BD247E8009302F8 /* RemoteRemovePowerupEvent.swift */; };
3CCA1EF02BD2861B009302F8 /* UpdatePostionEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CCA1EEF2BD2861B009302F8 /* UpdatePostionEvent.swift */; };
3CCF9CAF2BAB1A96004D170E /* SceneUpdateDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CCF9CAE2BAB1A96004D170E /* SceneUpdateDelegate.swift */; };
3CCF9CB12BAB1BCE004D170E /* GameWorld.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CCF9CB02BAB1BCE004D170E /* GameWorld.swift */; };
3CCF9CB32BAB1F42004D170E /* SystemManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CCF9CB22BAB1F42004D170E /* SystemManager.swift */; };
Expand Down Expand Up @@ -181,6 +183,10 @@
9B0406142BB89BE00026E903 /* PowerUpSelectionNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B0406132BB89BE00026E903 /* PowerUpSelectionNode.swift */; };
9B0406162BB89E140026E903 /* InvulnerabilityPowerUpDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B0406152BB89E140026E903 /* InvulnerabilityPowerUpDelegate.swift */; };
9B0406182BB8A1E10026E903 /* PowerUpDelegateFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B0406172BB8A1E10026E903 /* PowerUpDelegateFactory.swift */; };
9B274DC42BD24B210062715C /* DamagePowerUp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B274DC32BD24B210062715C /* DamagePowerUp.swift */; };
9B274DC62BD24C4F0062715C /* DamagePowerUpDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B274DC52BD24C4F0062715C /* DamagePowerUpDelegate.swift */; };
9B274DC82BD250420062715C /* NoCostPowerUp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B274DC72BD250420062715C /* NoCostPowerUp.swift */; };
9B274DCA2BD252330062715C /* NoCostPowerUpDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B274DC92BD252320062715C /* NoCostPowerUpDelegate.swift */; };
9B8696552BAD759F0002377C /* Grid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B8696542BAD759F0002377C /* Grid.swift */; };
9BC60BC82BB9BE6D001A6737 /* DisabledEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BC60BC72BB9BE6D001A6737 /* DisabledEvent.swift */; };
9BD669682BAFDE5E00DC8C4C /* GridDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD669672BAFDE5E00DC8C4C /* GridDelegate.swift */; };
Expand Down Expand Up @@ -319,12 +325,14 @@
3CAC4A742BB6BDD500A5D22E /* HealthRenderStage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HealthRenderStage.swift; sourceTree = "<group>"; };
3CBE72F82BC8D63500CC446A /* RemoteKillEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteKillEvent.swift; sourceTree = "<group>"; };
3CBE72FA2BC8D63E00CC446A /* RemoteDamageEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteDamageEvent.swift; sourceTree = "<group>"; };
3CBE72FC2BC8D64F00CC446A /* RemoteMoveEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteMoveEvent.swift; sourceTree = "<group>"; };
3CBE72FC2BC8D64F00CC446A /* RemoteSyncPositionEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteSyncPositionEvent.swift; sourceTree = "<group>"; };
3CBE72FE2BC8D66C00CC446A /* RemotePowerupEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemotePowerupEvent.swift; sourceTree = "<group>"; };
3CBE73002BC8D69A00CC446A /* RemoteLifeEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteLifeEvent.swift; sourceTree = "<group>"; };
3CBECF882BBE9797005EF39B /* TFNetworkCoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TFNetworkCoder.swift; sourceTree = "<group>"; };
3CBECF8B2BBE9A41005EF39B /* TFRemoteEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TFRemoteEvent.swift; sourceTree = "<group>"; };
3CBECF8D2BBE9EAC005EF39B /* RemoteSpawnEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteSpawnEvent.swift; sourceTree = "<group>"; };
3CCA1EED2BD247E8009302F8 /* RemoteRemovePowerupEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteRemovePowerupEvent.swift; sourceTree = "<group>"; };
3CCA1EEF2BD2861B009302F8 /* UpdatePostionEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdatePostionEvent.swift; sourceTree = "<group>"; };
3CCF9CAE2BAB1A96004D170E /* SceneUpdateDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneUpdateDelegate.swift; sourceTree = "<group>"; };
3CCF9CB02BAB1BCE004D170E /* GameWorld.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameWorld.swift; sourceTree = "<group>"; };
3CCF9CB22BAB1F42004D170E /* SystemManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemManager.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -448,6 +456,10 @@
9B0406132BB89BE00026E903 /* PowerUpSelectionNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PowerUpSelectionNode.swift; sourceTree = "<group>"; };
9B0406152BB89E140026E903 /* InvulnerabilityPowerUpDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvulnerabilityPowerUpDelegate.swift; sourceTree = "<group>"; };
9B0406172BB8A1E10026E903 /* PowerUpDelegateFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PowerUpDelegateFactory.swift; sourceTree = "<group>"; };
9B274DC32BD24B210062715C /* DamagePowerUp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamagePowerUp.swift; sourceTree = "<group>"; };
9B274DC52BD24C4F0062715C /* DamagePowerUpDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DamagePowerUpDelegate.swift; sourceTree = "<group>"; };
9B274DC72BD250420062715C /* NoCostPowerUp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoCostPowerUp.swift; sourceTree = "<group>"; };
9B274DC92BD252320062715C /* NoCostPowerUpDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoCostPowerUpDelegate.swift; sourceTree = "<group>"; };
9B8696542BAD759F0002377C /* Grid.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Grid.swift; sourceTree = "<group>"; };
9BC60BC72BB9BE6D001A6737 /* DisabledEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisabledEvent.swift; sourceTree = "<group>"; };
9BD669672BAFDE5E00DC8C4C /* GridDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GridDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -632,10 +644,11 @@
3CBECF8D2BBE9EAC005EF39B /* RemoteSpawnEvent.swift */,
3CBE72F82BC8D63500CC446A /* RemoteKillEvent.swift */,
3CBE73002BC8D69A00CC446A /* RemoteLifeEvent.swift */,
3CBE72FC2BC8D64F00CC446A /* RemoteMoveEvent.swift */,
3CBE72FC2BC8D64F00CC446A /* RemoteSyncPositionEvent.swift */,
3CBE72FA2BC8D63E00CC446A /* RemoteDamageEvent.swift */,
3CD37AA62BBEC5EF00222D8A /* BaseRemoteEvent.swift */,
3CBE72FE2BC8D66C00CC446A /* RemotePowerupEvent.swift */,
3CCA1EED2BD247E8009302F8 /* RemoteRemovePowerupEvent.swift */,
3CD7DE372BCEB6D200CB21F0 /* RemoteConcedeEvent.swift */,
);
path = RemoteEvents;
Expand Down Expand Up @@ -967,6 +980,10 @@
9B0406172BB8A1E10026E903 /* PowerUpDelegateFactory.swift */,
9B04060F2BB879990026E903 /* InvulnerabilityPowerUp.swift */,
9B0406152BB89E140026E903 /* InvulnerabilityPowerUpDelegate.swift */,
9B274DC32BD24B210062715C /* DamagePowerUp.swift */,
9B274DC52BD24C4F0062715C /* DamagePowerUpDelegate.swift */,
9B274DC72BD250420062715C /* NoCostPowerUp.swift */,
9B274DC92BD252320062715C /* NoCostPowerUpDelegate.swift */,
);
path = PowerUps;
sourceTree = "<group>";
Expand Down Expand Up @@ -1292,6 +1309,7 @@
3C9955C92BA5888F00D33FA5 /* SpawnEvent.swift */,
BA443D3E2BAD9774009F0FFB /* RemoveEvent.swift */,
5240D0AE2BB3B415004F1486 /* LifeEvent.swift */,
3CCA1EEF2BD2861B009302F8 /* UpdatePostionEvent.swift */,
527A077B2BB3F4CC00CD9D08 /* KillEvent.swift */,
9BC60BC72BB9BE6D001A6737 /* DisabledEvent.swift */,
3CD7DE392BCEB87900CB21F0 /* ConcedeEvent.swift */,
Expand Down Expand Up @@ -1624,8 +1642,9 @@
3CD37AA52BBEC10700222D8A /* FirebaseRemoteEventSubscriber.swift in Sources */,
BA82C7792BCC6943000515A0 /* CenturionAchievement.swift in Sources */,
BAEC9A002BD1A4B700E0C437 /* CustomAchievementCell.swift in Sources */,
9B274DC82BD250420062715C /* NoCostPowerUp.swift in Sources */,
52A794172BBC4F690083C976 /* GamePlayer.swift in Sources */,
3CBE72FD2BC8D64F00CC446A /* RemoteMoveEvent.swift in Sources */,
3CBE72FD2BC8D64F00CC446A /* RemoteSyncPositionEvent.swift in Sources */,
3CE951632BAE037C008B2785 /* AiSystem.swift in Sources */,
3CE9515F2BADE2C5008B2785 /* ShootingSystem.swift in Sources */,
5240D0AB2BB3340F004F1486 /* CaptureTheFlagMode.swift in Sources */,
Expand Down Expand Up @@ -1691,6 +1710,7 @@
527A07842BB3FD9A00CD9D08 /* TimerSystem.swift in Sources */,
BA82C7462BC8797F000515A0 /* StatisticsDatabase.swift in Sources */,
3C3CBDF72BB81D970001B8A9 /* TFCameraNode.swift in Sources */,
9B274DCA2BD252330062715C /* NoCostPowerUpDelegate.swift in Sources */,
BA82C76D2BCBD8F7000515A0 /* StatisticsDatabase+Merge.swift in Sources */,
3CE951562BACA0CF008B2785 /* Collidable.swift in Sources */,
BA82C7422BC86FE1000515A0 /* TotalGamesStatistic.swift in Sources */,
Expand All @@ -1708,8 +1728,11 @@
3C9955AF2BA48FD200D33FA5 /* MeleeUnit.swift in Sources */,
5240D0AD2BB33D4C004F1486 /* PositionSystem.swift in Sources */,
5295A2022BA9FBD9005018A8 /* SceneManagerDelegate.swift in Sources */,
9B274DC42BD24B210062715C /* DamagePowerUp.swift in Sources */,
52DF5FE12BA3349600135367 /* TFTextures.swift in Sources */,
520062582BA8ED73000DBA30 /* HomeComponent.swift in Sources */,
3CCA1EEE2BD247E8009302F8 /* RemoteRemovePowerupEvent.swift in Sources */,
3CCA1EF02BD2861B009302F8 /* UpdatePostionEvent.swift in Sources */,
52DF5FA82BA32B2300135367 /* AppDelegate.swift in Sources */,
5240D08F2BAE6D0A004F1486 /* Point.swift in Sources */,
3C769A742BA591BD00F454F9 /* SpawnSystem.swift in Sources */,
Expand Down Expand Up @@ -1775,6 +1798,7 @@
3CE951672BAEAB0E008B2785 /* ContactSystem.swift in Sources */,
529190E32BBFB59B001D8821 /* StatePopupNode.swift in Sources */,
3CE951692BAEB719008B2785 /* RequestSpawnEvent.swift in Sources */,
9B274DC62BD24C4F0062715C /* DamagePowerUpDelegate.swift in Sources */,
BA82C7832BCD2B30000515A0 /* Mission.swift in Sources */,
3CFA72E72BC0398E0081337F /* RemoteEventManager.swift in Sources */,
);
Expand Down
Binary file not shown.
33 changes: 24 additions & 9 deletions TowerForge/TowerForge/Commons/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,45 @@ class Constants {
}

struct PositionConstants {
private static let TOOLBAR_MID_Y = SizeConstants.TOOLBAR_HEIGHT / 2

static let POINTS_OWN = CGPoint(x: 70 / SizeConstants.SCALE_RATIO, y: TOOLBAR_MID_Y)

// Death Match Mode Properties Positions
static let DEATH_MATCH_POINT_OWN = CGPoint(x: 300, y: 50)
static let DEATH_MATCH_POINT_OPP = CGPoint(x: 300, y: 110)
static let DEATH_MATCH_POINT_OWN = CGPoint(x: 270 / SizeConstants.SCALE_RATIO,
y: TOOLBAR_MID_Y + SizeConstants.DEATH_MATCH_POINT_SIZE.height / 2 + 10)
static let DEATH_MATCH_POINT_OPP = CGPoint(x: 270 / SizeConstants.SCALE_RATIO,
y: TOOLBAR_MID_Y - SizeConstants.DEATH_MATCH_POINT_SIZE.height / 2 - 10)

// Capture the Flag Mode Properties
static let CTF_POINT_OWN = CGPoint(x: 300, y: 50)
static let CTF_POINT_OPP = CGPoint(x: 300, y: 110)
static let CTF_POINT_OWN = CGPoint(x: 270 / SizeConstants.SCALE_RATIO,
y: TOOLBAR_MID_Y + SizeConstants.CTF_POINT_SIZE.height / 2 + 10)
static let CTF_POINT_OPP = CGPoint(x: 270 / SizeConstants.SCALE_RATIO,
y: TOOLBAR_MID_Y - SizeConstants.CTF_POINT_SIZE.height / 2 - 10)

// Survival Mode Properties
static let SURVIVAL_POINT_OWN = CGPoint(x: 300, y: 100)
static let SURVIVAL_POINT_OWN = CGPoint(x: 270 / SizeConstants.SCALE_RATIO, y: TOOLBAR_MID_Y)

static let SUBTITLE_LABEL_OFFSET = CGPoint(x: 0, y: -30)
// Unit Node
static let UNIT_NODE_START = CGPoint(x: 450 / SizeConstants.SCALE_RATIO, y: TOOLBAR_MID_Y)

static let SUBTITLE_LABEL_OFFSET = CGPoint(x: 0, y: -30 / SizeConstants.SCALE_RATIO)
}

struct SizeConstants {
static let SCALE_RATIO = GameWorld.worldSize.height / UIScreen.main.bounds.height
static let TOOLBAR_HEIGHT = UIScreen.main.bounds.height / 5

static let POINT_SIZE = CGSize(width: 100 / SCALE_RATIO, height: 100 / SCALE_RATIO)

// Death Match Mode Properties Size
static let DEATH_MATCH_POINT_SIZE = CGSize(width: 50, height: 50)
static let DEATH_MATCH_POINT_SIZE = CGSize(width: 50 / SCALE_RATIO, height: 50 / SCALE_RATIO)

// Capture the Flag Mode Properties Size
static let CTF_POINT_SIZE = CGSize(width: 50, height: 50)
static let CTF_POINT_SIZE = CGSize(width: 50 / SCALE_RATIO, height: 50 / SCALE_RATIO)

// Survival Mode Properties Size
static let SURVIVAL_POINT_SIZE = CGSize(width: 100, height: 100)
static let SURVIVAL_POINT_SIZE = CGSize(width: 80 / SCALE_RATIO, height: 80 / SCALE_RATIO)

static let SCREEN_SIZE = CGSize(width: UIScreen.main.bounds.width,
height: UIScreen.main.bounds.height)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Vanessa Mae on 14/03/24.
//

import Foundation
import UIKit

class SpriteComponent: TFComponent {
var textures: TFTextures
Expand All @@ -14,6 +14,7 @@ class SpriteComponent: TFComponent {
var alpha = 1.0
var staticOnScreen = false
var zPosition: CGFloat
var tint: UIColor = .white

init(textureNames: [String], size: CGSize, animatableKey: String, zPosition: CGFloat = .zero) {
self.textures = TFTextures(textureNames: textureNames, textureAtlasName: "Sprites")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BaseTower: TFEntity {
maxHealth: CGFloat,
player: Player,
id: UUID = UUID()) {
super.init()
super.init(id: id)
// Core Components
self.addComponent(SpriteComponent(textureNames: textureNames, size: size,
animatableKey: key, zPosition: BaseTower.zPosition))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@
import Foundation

class Point: TFEntity {
static let position = CGPoint(x: 100, y: 100)
static let size = CGSize(width: 100, height: 100)

init(initialPoint: Int) {
super.init()
let spriteComponent = SpriteComponent(textureNames: ["Coin"], size: Point.size, animatableKey: "point")
let spriteComponent = SpriteComponent(textureNames: ["Coin"], size: SizeConstants.POINT_SIZE,
animatableKey: "point")

self.addComponent(spriteComponent)
self.addComponent(HomeComponent(initialLifeCount: Team.lifeCount, pointInterval: Team.pointsInterval))
self.addComponent(LabelComponent(text: String(initialPoint), name: "point"))
self.addComponent(PositionComponent(position: Point.position))
self.addComponent(PositionComponent(position: PositionConstants.POINTS_OWN))
self.addComponent(PlayerComponent(player: .ownPlayer))

spriteComponent.staticOnScreen = true
Expand Down
Loading

0 comments on commit 318813e

Please sign in to comment.