Skip to content

Commit

Permalink
Merge pull request #28 from cs3217-2324/feat/preloaded-level
Browse files Browse the repository at this point in the history
Preloaded Level
  • Loading branch information
ruihan00 committed Mar 26, 2024
2 parents d47fe49 + deeb221 commit 72d7363
Show file tree
Hide file tree
Showing 72 changed files with 438 additions and 147 deletions.
12 changes: 10 additions & 2 deletions SDPhysicsEngine/Sources/SDPhysicsEngine/Object/SDPhysicsBody.swift
Expand Up @@ -5,6 +5,9 @@ public class SDPhysicsBody {

public init(rectangleOf size: CGSize) {
body = SKPhysicsBody(rectangleOf: size)
body.friction = 0
body.linearDamping = 0
body.restitution = 0
}

public init(circleOf radius: CGFloat) {
Expand All @@ -22,8 +25,8 @@ public class SDPhysicsBody {
}

public var force: CGVector {
// get { body.force }
// set { body.force = newValue }
// get { body.force }
// set { body.force = newValue }
CGVector(dx: 0, dy: 0)
}

Expand All @@ -42,6 +45,11 @@ public class SDPhysicsBody {
set { body.isDynamic = newValue }
}

public var linearDamping: CGFloat {
get { body.linearDamping }
set { body.linearDamping = newValue }
}

public var categoryBitMask: UInt32 {
get { body.categoryBitMask }
set { body.categoryBitMask = newValue }
Expand Down
Binary file modified assets/character/red-nose/Idle (1).png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
18 changes: 13 additions & 5 deletions star-dash/star-dash.xcodeproj/project.pbxproj
Expand Up @@ -94,6 +94,8 @@
4E8660622BA0964A0035530D /* Obstacle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E8660612BA0964A0035530D /* Obstacle.swift */; };
4E8660642BA096600035530D /* Tool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E8660632BA096600035530D /* Tool.swift */; };
4E8660662BA097D40035530D /* PhysicsConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E8660652BA097D40035530D /* PhysicsConstants.swift */; };
4EC561E32BB1E98400166DDC /* PlayerObstacleContactEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC561E22BB1E98400166DDC /* PlayerObstacleContactEvent.swift */; };
4EC561E52BB1E9A300166DDC /* PlayerToolContactEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC561E42BB1E9A300166DDC /* PlayerToolContactEvent.swift */; };
E638B9CF2BAB3C5D00931CC2 /* TeleportEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = E638B9CE2BAB3C5D00931CC2 /* TeleportEvent.swift */; };
E64361102BA4C2CD003850FD /* SpriteModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E643610A2BA4C2CC003850FD /* SpriteModule.swift */; };
E64361112BA4C2CD003850FD /* SyncModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E643610B2BA4C2CC003850FD /* SyncModule.swift */; };
Expand Down Expand Up @@ -242,6 +244,8 @@
4E8660612BA0964A0035530D /* Obstacle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Obstacle.swift; sourceTree = "<group>"; };
4E8660632BA096600035530D /* Tool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tool.swift; sourceTree = "<group>"; };
4E8660652BA097D40035530D /* PhysicsConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhysicsConstants.swift; sourceTree = "<group>"; };
4EC561E22BB1E98400166DDC /* PlayerObstacleContactEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerObstacleContactEvent.swift; sourceTree = "<group>"; };
4EC561E42BB1E9A300166DDC /* PlayerToolContactEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerToolContactEvent.swift; sourceTree = "<group>"; };
E638B9CE2BAB3C5D00931CC2 /* TeleportEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeleportEvent.swift; sourceTree = "<group>"; };
E643610A2BA4C2CC003850FD /* SpriteModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpriteModule.swift; sourceTree = "<group>"; };
E643610B2BA4C2CC003850FD /* SyncModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyncModule.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -312,9 +316,9 @@
14E247942BA2CB480071FFC0 /* EventManager.swift */,
145F2C832BA22CA300457549 /* EventModifiable.swift */,
460A20082BB1B524002597B8 /* EventListener.swift */,
14D14B782BA5ABAC00386C3B /* MonsterEvents */,
1471B0AB2BA6AE4400878B14 /* ToolEvents */,
14D14B742BA5A72800386C3B /* PlayerEvents */,
14D14B782BA5ABAC00386C3B /* MonsterEvents */,
14D14B772BA5AB0700386C3B /* ContactEvents */,
14D14B792BA5AC1900386C3B /* CommonEvents */,
);
Expand Down Expand Up @@ -344,6 +348,8 @@
children = (
E6B0AAD42BAAE4EC009CB939 /* PlayerFloorContactEvent.swift */,
143AA3922BA4DBE7009C28E7 /* PlayerMonsterContactEvent.swift */,
4EC561E22BB1E98400166DDC /* PlayerObstacleContactEvent.swift */,
4EC561E42BB1E9A300166DDC /* PlayerToolContactEvent.swift */,
);
path = ContactEvents;
sourceTree = "<group>";
Expand Down Expand Up @@ -823,6 +829,7 @@
E6B1DC902BA34A4800473563 /* SDPhysicsEngine in Sources */,
4E630F272B9F7E770008F887 /* Entity.swift in Sources */,
4E630F2C2B9F7F460008F887 /* Component.swift in Sources */,
4EC561E52BB1E9A300166DDC /* PlayerToolContactEvent.swift in Sources */,
143AA38F2BA4D61A009C28E7 /* CGVector.swift in Sources */,
14E2478E2BA22FCE0071FFC0 /* MoveEvent.swift in Sources */,
14D14B732BA5A3CD00386C3B /* RemoveEvent.swift in Sources */,
Expand Down Expand Up @@ -865,6 +872,7 @@
E6B0AAD32BAAE438009CB939 /* ControlViewDelegate.swift in Sources */,
4604BBD92BA81C940078B84C /* InventorySystem.swift in Sources */,
14E247952BA2CB480071FFC0 /* EventManager.swift in Sources */,
4EC561E32BB1E98400166DDC /* PlayerObstacleContactEvent.swift in Sources */,
4E630EF82B9F7E070008F887 /* SceneDelegate.swift in Sources */,
E69FDDE02BAD3DAD0089D5F3 /* PointsComponent.swift in Sources */,
14970F542BA8163300CC1E8A /* ScoreSystem.swift in Sources */,
Expand Down Expand Up @@ -1102,7 +1110,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = EBN5NJJVSU;
DEVELOPMENT_TEAM = VFS4882B2L;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "star-dash/Info.plist";
Expand All @@ -1117,7 +1125,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "junyi-sd";
PRODUCT_BUNDLE_IDENTIFIER = "ruihan-sd";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
Expand All @@ -1136,7 +1144,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = EBN5NJJVSU;
DEVELOPMENT_TEAM = VFS4882B2L;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "star-dash/Info.plist";
Expand All @@ -1151,7 +1159,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "junyi-sd";
PRODUCT_BUNDLE_IDENTIFIER = "ruihan-sd";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
Expand Down
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Run (1).png",
"filename" : "block.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
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 star-dash/star-dash/Assets.xcassets/Monster.imageset/Contents.json
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Idle (13).png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Run (3).png",
"filename" : "Run 1.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Run (2).png",
"filename" : "Run 10.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Run (4).png",
"filename" : "Run 2.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 72d7363

Please sign in to comment.