Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:cs3217-2324/group-project-star-dash…
… into entity
- Loading branch information
Showing
27 changed files
with
461 additions
and
0 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
6 changes: 6 additions & 0 deletions
6
star-dash/star-dash/Assets.xcassets/red-nose.spriteatlas/Contents.json
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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
star-dash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (1).imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Run (1).png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+64.6 KB
...ash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (1).imageset/Run (1).png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
star-dash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (2).imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Run (2).png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+74.6 KB
...ash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (2).imageset/Run (2).png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
star-dash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (3).imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Run (3).png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+75.9 KB
...ash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (3).imageset/Run (3).png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
star-dash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (4).imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Run (4).png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+69.5 KB
...ash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (4).imageset/Run (4).png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
star-dash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (5).imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Run (5).png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+65.9 KB
...ash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (5).imageset/Run (5).png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
star-dash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (6).imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Run (6).png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+75.7 KB
...ash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (6).imageset/Run (6).png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
star-dash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (7).imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Run (7).png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+77.3 KB
...ash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (7).imageset/Run (7).png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
star-dash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (8).imageset/Contents.json
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,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Run (8).png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+70.2 KB
...ash/star-dash/Assets.xcassets/red-nose.spriteatlas/Run (8).imageset/Run (8).png
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// Component.swift | ||
// star-dash | ||
// | ||
// Created by Lau Rui han on 12/3/24. | ||
// | ||
|
||
import Foundation | ||
typealias ComponentId = UUID | ||
class Component { | ||
var entityId: UUID | ||
var id: UUID | ||
|
||
init(id: UUID, entityId: UUID) { | ||
self.id = id | ||
self.entityId = entityId | ||
|
||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
star-dash/star-dash/Entities/Components/HealthComponent.swift
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,21 @@ | ||
// | ||
// HealthComponent.swift | ||
// star-dash | ||
// | ||
// Created by Lau Rui han on 12/3/24. | ||
// | ||
|
||
import Foundation | ||
|
||
class HealthComponent: Component { | ||
var health: Int | ||
|
||
init(id: UUID, entityId: UUID, health: Int) { | ||
self.health = health | ||
super.init(id: id, entityId: entityId) | ||
} | ||
|
||
convenience init(entityId: UUID, health: Int) { | ||
self.init(id: UUID(), entityId: entityId, health: health) | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
star-dash/star-dash/Entities/Components/PhysicsComponent.swift
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,29 @@ | ||
// | ||
// PhysicsComponent.swift | ||
// star-dash | ||
// | ||
// Created by Lau Rui han on 12/3/24. | ||
// | ||
|
||
import Foundation | ||
|
||
class PhysicsComponent: Component { | ||
var mass: CGFloat | ||
var velocity: CGVector | ||
var force: CGVector | ||
var collisionMask: UInt32 | ||
var affectedByGravity: Bool | ||
|
||
init(id: UUID, entityId: UUID, mass: CGFloat, velocity: CGVector, force: CGVector, collisionMask: UInt32, affectedByGravity: Bool) { | ||
self.mass = mass | ||
self.velocity = velocity | ||
self.force = force | ||
self.collisionMask = collisionMask | ||
self.affectedByGravity = affectedByGravity | ||
super.init(id: id, entityId: entityId) | ||
} | ||
|
||
convenience init(entityId: UUID, mass: CGFloat, velocity: CGVector, force: CGVector, collisionMask: UInt32, affectedByGravity: Bool) { | ||
self.init(id: UUID(), entityId: entityId, mass: mass, velocity: velocity, force: force, collisionMask: collisionMask, affectedByGravity: affectedByGravity) | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
star-dash/star-dash/Entities/Components/PositionComponent.swift
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,33 @@ | ||
// | ||
// PositionComponent.swift | ||
// star-dash | ||
// | ||
// Created by Lau Rui han on 12/3/24. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
class PositionComponent: Component { | ||
var position: CGPoint | ||
var rotation: Float | ||
|
||
init(id: UUID, entityId: UUID, position: CGPoint, rotation: Float) { | ||
self.position = position | ||
self.rotation = rotation | ||
super.init(id: id, entityId: entityId) | ||
} | ||
|
||
convenience init(entityId: UUID, position: CGPoint, rotation: Float) { | ||
self.init(id: UUID(), entityId: entityId, position: position, rotation: rotation) | ||
} | ||
|
||
func setPosition(position: CGPoint) { | ||
self.position = position | ||
} | ||
|
||
func setRotation(rotation: Float) { | ||
self.rotation = rotation | ||
} | ||
|
||
} |
Oops, something went wrong.