Skip to content

Commit

Permalink
Merge pull request #41 from cs3217-2324/chores
Browse files Browse the repository at this point in the history
Chore/remove sprite from persistence and remove unused assets
  • Loading branch information
jasonqiu212 committed Mar 28, 2024
2 parents 4d838ad + 25be400 commit 25daed0
Show file tree
Hide file tree
Showing 71 changed files with 30 additions and 227 deletions.
22 changes: 15 additions & 7 deletions star-dash/star-dash.xcodeproj/project.pbxproj
Expand Up @@ -382,6 +382,19 @@
path = CommonEvents;
sourceTree = "<group>";
};
14E58BC42BB57E8000D5ABC3 /* Persistables */ = {
isa = PBXGroup;
children = (
4E59E25C2BAB405A007B3FA7 /* EntityPersistable.swift */,
4E59E2602BAB42FD007B3FA7 /* LevelPersistable.swift */,
4E59E2652BADA79A007B3FA7 /* MonsterEntityPersistable.swift */,
4E59E26B2BADA7DD007B3FA7 /* ObstacleEntityPersistable.swift */,
4E59E2672BADA7B6007B3FA7 /* CollectibleEntityPersistable.swift */,
4E59E2692BADA7C7007B3FA7 /* ToolEntityPersistable.swift */,
);
path = Persistables;
sourceTree = "<group>";
};
4611488F2BA1CD9E0073E7E1 /* Systems */ = {
isa = PBXGroup;
children = (
Expand All @@ -403,6 +416,7 @@
46B8C0982BA328BF00498705 /* GameEngine */ = {
isa = PBXGroup;
children = (
145F2C7E2BA2039700457549 /* Events */,
46D418142BA5CB760091A38B /* Collision */,
4611488F2BA1CD9E0073E7E1 /* Systems */,
4E630F282B9F7EC20008F887 /* Components */,
Expand Down Expand Up @@ -456,12 +470,7 @@
4E59E2642BAD9A06007B3FA7 /* Data */,
4E59E2502BAB2EAE007B3FA7 /* StorageManager.swift */,
4E59E2522BAB3061007B3FA7 /* Database.swift */,
4E59E25C2BAB405A007B3FA7 /* EntityPersistable.swift */,
4E59E2602BAB42FD007B3FA7 /* LevelPersistable.swift */,
4E59E2652BADA79A007B3FA7 /* MonsterEntityPersistable.swift */,
4E59E26B2BADA7DD007B3FA7 /* ObstacleEntityPersistable.swift */,
4E59E2672BADA7B6007B3FA7 /* CollectibleEntityPersistable.swift */,
4E59E2692BADA7C7007B3FA7 /* ToolEntityPersistable.swift */,
14E58BC42BB57E8000D5ABC3 /* Persistables */,
);
path = Persistence;
sourceTree = "<group>";
Expand Down Expand Up @@ -516,7 +525,6 @@
E6A745102BA057040080C1BE /* Rendering */,
4E86605D2BA095CC0035530D /* Constants */,
4E630F352B9F91C20008F887 /* Enums */,
145F2C7E2BA2039700457549 /* Events */,
143AA38D2BA4D600009C28E7 /* Extensions */,
4E630EF52B9F7E070008F887 /* AppDelegate.swift */,
4E630EF72B9F7E070008F887 /* SceneDelegate.swift */,
Expand Down
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Run 1.png",
"filename" : "obstacle.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Run 10.png",
"filename" : "Run (10).png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "block.png",
"filename" : "Run (9).png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions star-dash/star-dash/Constants/SpriteConstants.swift
Expand Up @@ -9,4 +9,10 @@ struct SpriteConstants {
)

static let star = "Star"

static let monster = "Monster"

static let obstacle = "Obstacle"

static let tool = "Tool"
}
15 changes: 5 additions & 10 deletions star-dash/star-dash/GameEngine/Entities/EntityFactory.swift
Expand Up @@ -10,8 +10,7 @@ import Foundation
struct EntityFactory {
static func createAndAddPlayer(to entityManager: EntityManagerInterface,
playerIndex: Int,
position: CGPoint,
sprite: PlayerSprite) {
position: CGPoint) {
let playerBuilder = EntityBuilder(entity: Player(id: UUID()), entityManager: entityManager)

playerBuilder
Expand All @@ -35,14 +34,13 @@ struct EntityFactory {
static func createAndAddMonster(to entityManager: EntityManagerInterface,
position: CGPoint,
health: Int,
sprite: String,
size: CGSize) {
let monsterBuilder = EntityBuilder(entity: Monster(id: UUID()), entityManager: entityManager)

monsterBuilder
.withPosition(at: position)
.withHealth(health: health)
.withSprite(image: sprite,
.withSprite(image: SpriteConstants.monster,
textureSet: nil,
textureAtlas: nil,
size: size)
Expand All @@ -53,14 +51,13 @@ struct EntityFactory {

static func createAndAddCollectible(to entityManager: EntityManagerInterface,
position: CGPoint,
sprite: String,
points: Int,
size: CGSize) {
let collectibleBuilder = EntityBuilder(entity: Collectible(id: UUID()), entityManager: entityManager)

collectibleBuilder
.withPosition(at: position)
.withSprite(image: sprite,
.withSprite(image: SpriteConstants.star,
textureSet: nil,
textureAtlas: nil,
size: size)
Expand All @@ -76,13 +73,12 @@ struct EntityFactory {

static func createAndAddObstacle(to entityManager: EntityManagerInterface,
position: CGPoint,
sprite: String,
size: CGSize) {
let obstacleBuilder = EntityBuilder(entity: Obstacle(id: UUID()), entityManager: entityManager)

obstacleBuilder
.withPosition(at: position)
.withSprite(image: sprite,
.withSprite(image: SpriteConstants.obstacle,
textureSet: nil,
textureAtlas: nil,
size: size)
Expand All @@ -94,13 +90,12 @@ struct EntityFactory {

static func createAndAddTool(to entityManager: EntityManagerInterface,
position: CGPoint,
sprite: String,
size: CGSize) {
let toolBuilder = EntityBuilder(entity: Tool(id: UUID()), entityManager: entityManager)

toolBuilder
.withPosition(at: position)
.withSprite(image: sprite,
.withSprite(image: SpriteConstants.tool,
textureSet: nil,
textureAtlas: nil,
size: size)
Expand Down
File renamed without changes.

0 comments on commit 25daed0

Please sign in to comment.