├── get-out
├── enemy.png
├── button.png
├── player.png
├── GameScene.sks
├── healthbar.png
├── tile_floor.png
├── tile_wall.png
├── tile_example.png
├── joystick_move.png
├── joystick_shoot.png
├── tile_floor_selected.png
├── WalkImages.atlas
│ ├── player_walk_east_1.png
│ ├── player_walk_east_2.png
│ ├── player_walk_west_1.png
│ ├── player_walk_west_2.png
│ ├── player_walk_north_1.png
│ ├── player_walk_north_2.png
│ ├── player_walk_south_1.png
│ └── player_walk_south_2.png
├── Images.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Icon-40@2x.png
│ │ ├── Icon-60@2x.png
│ │ ├── Icon-60@3x.png
│ │ ├── Icon-Small@2x.png
│ │ └── Contents.json
│ └── LaunchImage.launchimage
│ │ └── Contents.json
├── levels
│ └── 1.txt
├── Collisions.swift
├── SubclassNode.swift
├── TileFactory.swift
├── Button.swift
├── Camera.swift
├── DebugLabel.swift
├── Healthbar.swift
├── Info.plist
├── LocationLogic.swift
├── Enemy.swift
├── Base.lproj
│ └── Main.storyboard
├── DebugOverlay.swift
├── AppDelegate.swift
├── GameViewController.swift
├── Joystick.swift
├── AnimationActionsFactory.swift
├── Tile.swift
├── Player.swift
├── GameScene.swift
└── World.swift
├── README.md
├── images
├── enemy
│ ├── enemy.png
│ └── enemy.pxm
├── player
│ ├── player.png
│ ├── player.pxm
│ ├── player_background.png
│ ├── player_background.pxm
│ ├── walk_east
│ │ ├── player_walk_east_1.png
│ │ ├── player_walk_east_1.pxm
│ │ ├── player_walk_east_2.png
│ │ ├── player_walk_east_2.pxm
│ │ └── player_walk_east_Idle.pxm
│ ├── walk_west
│ │ ├── player_walk_west_1.png
│ │ ├── player_walk_west_1.pxm
│ │ ├── player_walk_west_2.png
│ │ └── player_walk_west_2.pxm
│ ├── walk_north
│ │ ├── player_walk_north_1.pxm
│ │ ├── player_walk_north_2.pxm
│ │ └── player_walk_north_Idle.pxm
│ ├── walk_south
│ │ ├── player_walk_south_1.png
│ │ ├── player_walk_south_1.pxm
│ │ ├── player_walk_south_2.png
│ │ └── player_walk_south_2.pxm
│ └── WalkImages.atlas
│ │ ├── player_walk_east_1.png
│ │ ├── player_walk_east_2.png
│ │ ├── player_walk_north_1.png
│ │ ├── player_walk_north_2.png
│ │ ├── player_walk_south_1.png
│ │ ├── player_walk_south_2.png
│ │ ├── player_walk_west_1.png
│ │ └── player_walk_west_2.png
├── ui
│ ├── healthbar.png
│ └── healthbar.pxm
├── controls
│ ├── button.png
│ ├── button.pxm
│ ├── joystick_move.png
│ ├── joystick_move.pxm
│ ├── joystick_shoot.png
│ └── joystick_shoot.pxm
├── tiles
│ ├── tile_floor.png
│ ├── tile_floor.pxm
│ ├── tile_wall.png
│ ├── tile_wall.pxm
│ ├── tile_example.png
│ ├── tile_example.pxm
│ ├── tile_floor_selected.png
│ └── tile_floor_selected.pxm
├── appicon
│ ├── Icon-40@2x.png
│ ├── Icon-60@2x.png
│ ├── Icon-60@3x.png
│ ├── Icon-60@2x-1.png
│ ├── Icon-Small@2x.png
│ ├── Icon-Small@3x.png
│ └── app icon full size.png
└── concepts
│ └── concept 001.pxm
├── get-out.xcodeproj
├── xcuserdata
│ └── cor.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── get-out.xcscheme
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── cor.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── get-out.xccheckout
└── project.pbxproj
├── get-outTests
├── Info.plist
└── get_outTests.swift
└── Weapon.swift
/get-out/enemy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/enemy.png
--------------------------------------------------------------------------------
/get-out/button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/button.png
--------------------------------------------------------------------------------
/get-out/player.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/player.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | get-out
2 | =======
3 |
4 | A work in progress top down shooter for iOS
5 |
6 |
--------------------------------------------------------------------------------
/get-out/GameScene.sks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/GameScene.sks
--------------------------------------------------------------------------------
/get-out/healthbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/healthbar.png
--------------------------------------------------------------------------------
/get-out/tile_floor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/tile_floor.png
--------------------------------------------------------------------------------
/get-out/tile_wall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/tile_wall.png
--------------------------------------------------------------------------------
/images/enemy/enemy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/enemy/enemy.png
--------------------------------------------------------------------------------
/images/enemy/enemy.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/enemy/enemy.pxm
--------------------------------------------------------------------------------
/get-out/tile_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/tile_example.png
--------------------------------------------------------------------------------
/images/player/player.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/player.png
--------------------------------------------------------------------------------
/images/player/player.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/player.pxm
--------------------------------------------------------------------------------
/images/ui/healthbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/ui/healthbar.png
--------------------------------------------------------------------------------
/images/ui/healthbar.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/ui/healthbar.pxm
--------------------------------------------------------------------------------
/get-out/joystick_move.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/joystick_move.png
--------------------------------------------------------------------------------
/get-out/joystick_shoot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/joystick_shoot.png
--------------------------------------------------------------------------------
/images/controls/button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/controls/button.png
--------------------------------------------------------------------------------
/images/controls/button.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/controls/button.pxm
--------------------------------------------------------------------------------
/images/tiles/tile_floor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/tiles/tile_floor.png
--------------------------------------------------------------------------------
/images/tiles/tile_floor.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/tiles/tile_floor.pxm
--------------------------------------------------------------------------------
/images/tiles/tile_wall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/tiles/tile_wall.png
--------------------------------------------------------------------------------
/images/tiles/tile_wall.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/tiles/tile_wall.pxm
--------------------------------------------------------------------------------
/images/appicon/Icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/appicon/Icon-40@2x.png
--------------------------------------------------------------------------------
/images/appicon/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/appicon/Icon-60@2x.png
--------------------------------------------------------------------------------
/images/appicon/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/appicon/Icon-60@3x.png
--------------------------------------------------------------------------------
/images/tiles/tile_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/tiles/tile_example.png
--------------------------------------------------------------------------------
/images/tiles/tile_example.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/tiles/tile_example.pxm
--------------------------------------------------------------------------------
/get-out/tile_floor_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/tile_floor_selected.png
--------------------------------------------------------------------------------
/images/appicon/Icon-60@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/appicon/Icon-60@2x-1.png
--------------------------------------------------------------------------------
/images/appicon/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/appicon/Icon-Small@2x.png
--------------------------------------------------------------------------------
/images/appicon/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/appicon/Icon-Small@3x.png
--------------------------------------------------------------------------------
/images/concepts/concept 001.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/concepts/concept 001.pxm
--------------------------------------------------------------------------------
/images/controls/joystick_move.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/controls/joystick_move.png
--------------------------------------------------------------------------------
/images/controls/joystick_move.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/controls/joystick_move.pxm
--------------------------------------------------------------------------------
/images/controls/joystick_shoot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/controls/joystick_shoot.png
--------------------------------------------------------------------------------
/images/controls/joystick_shoot.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/controls/joystick_shoot.pxm
--------------------------------------------------------------------------------
/images/appicon/app icon full size.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/appicon/app icon full size.png
--------------------------------------------------------------------------------
/images/player/player_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/player_background.png
--------------------------------------------------------------------------------
/images/player/player_background.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/player_background.pxm
--------------------------------------------------------------------------------
/images/tiles/tile_floor_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/tiles/tile_floor_selected.png
--------------------------------------------------------------------------------
/images/tiles/tile_floor_selected.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/tiles/tile_floor_selected.pxm
--------------------------------------------------------------------------------
/get-out/WalkImages.atlas/player_walk_east_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/WalkImages.atlas/player_walk_east_1.png
--------------------------------------------------------------------------------
/get-out/WalkImages.atlas/player_walk_east_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/WalkImages.atlas/player_walk_east_2.png
--------------------------------------------------------------------------------
/get-out/WalkImages.atlas/player_walk_west_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/WalkImages.atlas/player_walk_west_1.png
--------------------------------------------------------------------------------
/get-out/WalkImages.atlas/player_walk_west_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/WalkImages.atlas/player_walk_west_2.png
--------------------------------------------------------------------------------
/images/player/walk_east/player_walk_east_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_east/player_walk_east_1.png
--------------------------------------------------------------------------------
/images/player/walk_east/player_walk_east_1.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_east/player_walk_east_1.pxm
--------------------------------------------------------------------------------
/images/player/walk_east/player_walk_east_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_east/player_walk_east_2.png
--------------------------------------------------------------------------------
/images/player/walk_east/player_walk_east_2.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_east/player_walk_east_2.pxm
--------------------------------------------------------------------------------
/images/player/walk_west/player_walk_west_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_west/player_walk_west_1.png
--------------------------------------------------------------------------------
/images/player/walk_west/player_walk_west_1.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_west/player_walk_west_1.pxm
--------------------------------------------------------------------------------
/images/player/walk_west/player_walk_west_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_west/player_walk_west_2.png
--------------------------------------------------------------------------------
/images/player/walk_west/player_walk_west_2.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_west/player_walk_west_2.pxm
--------------------------------------------------------------------------------
/get-out/WalkImages.atlas/player_walk_north_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/WalkImages.atlas/player_walk_north_1.png
--------------------------------------------------------------------------------
/get-out/WalkImages.atlas/player_walk_north_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/WalkImages.atlas/player_walk_north_2.png
--------------------------------------------------------------------------------
/get-out/WalkImages.atlas/player_walk_south_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/WalkImages.atlas/player_walk_south_1.png
--------------------------------------------------------------------------------
/get-out/WalkImages.atlas/player_walk_south_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/WalkImages.atlas/player_walk_south_2.png
--------------------------------------------------------------------------------
/images/player/walk_east/player_walk_east_Idle.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_east/player_walk_east_Idle.pxm
--------------------------------------------------------------------------------
/images/player/walk_north/player_walk_north_1.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_north/player_walk_north_1.pxm
--------------------------------------------------------------------------------
/images/player/walk_north/player_walk_north_2.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_north/player_walk_north_2.pxm
--------------------------------------------------------------------------------
/images/player/walk_south/player_walk_south_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_south/player_walk_south_1.png
--------------------------------------------------------------------------------
/images/player/walk_south/player_walk_south_1.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_south/player_walk_south_1.pxm
--------------------------------------------------------------------------------
/images/player/walk_south/player_walk_south_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_south/player_walk_south_2.png
--------------------------------------------------------------------------------
/images/player/walk_south/player_walk_south_2.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_south/player_walk_south_2.pxm
--------------------------------------------------------------------------------
/images/player/walk_north/player_walk_north_Idle.pxm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/walk_north/player_walk_north_Idle.pxm
--------------------------------------------------------------------------------
/images/player/WalkImages.atlas/player_walk_east_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/WalkImages.atlas/player_walk_east_1.png
--------------------------------------------------------------------------------
/images/player/WalkImages.atlas/player_walk_east_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/WalkImages.atlas/player_walk_east_2.png
--------------------------------------------------------------------------------
/images/player/WalkImages.atlas/player_walk_north_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/WalkImages.atlas/player_walk_north_1.png
--------------------------------------------------------------------------------
/images/player/WalkImages.atlas/player_walk_north_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/WalkImages.atlas/player_walk_north_2.png
--------------------------------------------------------------------------------
/images/player/WalkImages.atlas/player_walk_south_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/WalkImages.atlas/player_walk_south_1.png
--------------------------------------------------------------------------------
/images/player/WalkImages.atlas/player_walk_south_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/WalkImages.atlas/player_walk_south_2.png
--------------------------------------------------------------------------------
/images/player/WalkImages.atlas/player_walk_west_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/WalkImages.atlas/player_walk_west_1.png
--------------------------------------------------------------------------------
/images/player/WalkImages.atlas/player_walk_west_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/images/player/WalkImages.atlas/player_walk_west_2.png
--------------------------------------------------------------------------------
/get-out/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/Images.xcassets/AppIcon.appiconset/Icon-40@2x.png
--------------------------------------------------------------------------------
/get-out/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png
--------------------------------------------------------------------------------
/get-out/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png
--------------------------------------------------------------------------------
/get-out/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/get-out/levels/1.txt:
--------------------------------------------------------------------------------
1 | OOOOOOOOOO
2 | OOOOOOOOOO
3 | OXXXXOOOOO
4 | OXOOOOOOOO
5 | OXXXXOOOOO
6 | OOOOOOOOOO
7 | OOOOOOOOOO
8 | OOOOOOOOOO
9 | OOOOOOOOOX
10 | OOOOOOOOXX
--------------------------------------------------------------------------------
/get-out.xcodeproj/xcuserdata/cor.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/get-out.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/get-out.xcodeproj/project.xcworkspace/xcuserdata/cor.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CoR/get-out/master/get-out.xcodeproj/project.xcworkspace/xcuserdata/cor.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/get-out/Collisions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Collisions.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 26-10-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 |
12 | enum ColliderType: UInt32 {
13 | case Player = 1
14 | case Enemy = 2
15 |
16 | case Bullet = 3
17 | }
--------------------------------------------------------------------------------
/get-out/SubclassNode.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SubclassNode.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 26-10-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | // this class is required for subclassing SKSpriteNode, subclass this instead of SKSpriteNode
12 | class SubclassNode: SKSpriteNode { }
13 |
--------------------------------------------------------------------------------
/get-out/Images.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "extent" : "full-screen",
7 | "minimum-system-version" : "7.0",
8 | "scale" : "2x"
9 | },
10 | {
11 | "orientation" : "portrait",
12 | "idiom" : "iphone",
13 | "subtype" : "retina4",
14 | "extent" : "full-screen",
15 | "minimum-system-version" : "7.0",
16 | "scale" : "2x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/get-out/TileFactory.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TileDefinition.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 07-10-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | struct TileDefinition {
12 | let textureName: String
13 | let collides: Bool
14 | }
15 |
16 | class TileFactory {
17 | var tileDefinitions: [String : TileDefinition] = [:]
18 |
19 | init() {
20 | tileDefinitions = [
21 | "floor" : TileDefinition(textureName: "tile_floor", collides: false),
22 | "wall" : TileDefinition(textureName: "tile_wall", collides: true)
23 | ]
24 | }
25 | }
--------------------------------------------------------------------------------
/get-out/Button.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Button.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 09-10-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | class Button {
12 |
13 | let sprite: SKSpriteNode
14 |
15 |
16 | init() {
17 | sprite = SKSpriteNode(imageNamed: "button")
18 | sprite.size = CGSize(width: 96, height: 128)
19 | sprite.position = CGPoint()
20 | sprite.texture?.filteringMode = .Nearest
21 | }
22 |
23 | convenience init(position: CGPoint) {
24 | self.init()
25 | sprite.position = position
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/get-out/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-Small@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "40x40",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-40@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "60x60",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-60@2x.png",
19 | "scale" : "2x"
20 | },
21 | {
22 | "size" : "60x60",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-60@3x.png",
25 | "scale" : "3x"
26 | }
27 | ],
28 | "info" : {
29 | "version" : 1,
30 | "author" : "xcode"
31 | }
32 | }
--------------------------------------------------------------------------------
/get-out.xcodeproj/xcuserdata/cor.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | get-out.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 8734315A19BB74C400050D5B
16 |
17 | primary
18 |
19 |
20 | 8734317019BB74C400050D5B
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/get-out/Camera.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Camera.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 23-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | //the scene will center on this node
12 |
13 | class Camera: SubclassNode {
14 |
15 | func centerOnNode(node: SKNode) {
16 |
17 | let cameraPositionInScene: CGPoint = scene!.convertPoint(position, fromNode: parent!)
18 | let newPosition = CGPoint(x: parent!.position.x - cameraPositionInScene.x, y: parent!.position.y - cameraPositionInScene.y)
19 |
20 | // smooth camera movement using easings
21 | let action = SKAction.moveTo(newPosition, duration: 0.2)
22 | action.timingMode = SKActionTimingMode.EaseOut
23 |
24 | parent!.runAction(action)
25 | }
26 | }
--------------------------------------------------------------------------------
/get-outTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | self.edu.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/get-out/DebugLabel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DebugLabel.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 30-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | class DebugLabel {
12 | let label: SKLabelNode
13 | var name: String
14 | var value: String
15 |
16 | // MARK: Initializers
17 | init() {
18 | label = SKLabelNode()
19 | label.fontName = "Helvetica"
20 | label.fontSize = 16;
21 | label.verticalAlignmentMode = SKLabelVerticalAlignmentMode.Top
22 | label.horizontalAlignmentMode = SKLabelHorizontalAlignmentMode.Left
23 |
24 | name = "test"
25 | value = "3"
26 | }
27 |
28 | convenience init(position: CGPoint) {
29 | self.init()
30 | label.position = position
31 | }
32 |
33 | // MARK: Update function
34 | func update(newValue: String) {
35 | value = newValue
36 | label.text = "\(name) : \(value)"
37 | }
38 | }
--------------------------------------------------------------------------------
/get-outTests/get_outTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // get_outTests.swift
3 | // get-outTests
4 | //
5 | // Created by Cor Pruijs on 06-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import XCTest
11 |
12 | class get_outTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | XCTAssert(true, "Pass")
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measureBlock() {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/get-out/Healthbar.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Healthbar.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 30-10-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | class HealthBar: SubclassNode {
12 |
13 | // the inner part of the healthbar, that displays the amount of health left
14 | private let progressNode = SKSpriteNode(color: UIColor.redColor(), size: CGSize(width: 200, height: 20))
15 |
16 | override init() {
17 | // TODO
18 | super.init(texture: nil, color: UIColor.blackColor(), size: CGSize(width: 204, height: 24) )
19 |
20 | // set the anchorpoint to the top left corner, since it will be there in the screen
21 | anchorPoint = CGPoint(x: 0, y: 1)
22 |
23 |
24 | // progressnode setup
25 | progressNode.anchorPoint = CGPoint(x: 0, y: 1)
26 | progressNode.position = CGPoint(x: 2, y: -2)
27 | addChild(progressNode)
28 |
29 | }
30 |
31 | func setHealth(health: Int) {
32 | progressNode.size.width = CGFloat(health) * 2
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/get-out/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | self.edu.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UIStatusBarHidden
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationLandscapeLeft
36 | UIInterfaceOrientationLandscapeRight
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/get-out/LocationLogic.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GridPoint.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 28-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | struct GridPoint {
12 | var x: Int
13 | var y: Int
14 | }
15 |
16 | enum Direction {
17 | case North
18 | case East
19 | case South
20 | case West
21 | }
22 |
23 | func directionfromVector(vector:CGVector) -> Direction? {
24 |
25 | let minimumSpeedForDirection: CGFloat = 5
26 |
27 | let dxPositive = vector.dx > 0
28 | let dyPositive = vector.dy > 0
29 | let dx = vector.dx
30 | let dy = vector.dy
31 |
32 |
33 | if !((dx > minimumSpeedForDirection || dx < -minimumSpeedForDirection) || (dy > minimumSpeedForDirection || dy < -minimumSpeedForDirection)) {
34 | return nil
35 | }
36 |
37 | if dyPositive {
38 |
39 | if dy > dx && dy > -dx {
40 | return .North
41 | }
42 | }
43 | if dxPositive {
44 | if dx > dy && dx > -dy {
45 | return .East
46 | }
47 | }
48 | if !dyPositive {
49 | if dy < dx && dy < -dx {
50 | return .South
51 | }
52 | }
53 | if !dxPositive {
54 | if dx < dy && dx < -dy {
55 | return .West
56 | }
57 | }
58 |
59 | // Invalid vector
60 | return nil
61 | }
62 |
--------------------------------------------------------------------------------
/get-out/Enemy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Enemey.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 09-10-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | class Enemy: SubclassNode {
12 |
13 |
14 | var health: Int = 100
15 |
16 | var isAlive: Bool {
17 | return health > 0
18 | }
19 |
20 |
21 | override init() {
22 |
23 | super.init(texture: nil, color: nil, size: CGSize())
24 |
25 | //sprite configuration
26 | name = "enemy"
27 | size = CGSize(width: 64, height: 64)
28 | texture = SKTexture(imageNamed: "enemy")
29 | texture?.filteringMode = .Nearest
30 |
31 | //position
32 | zPosition = 100
33 |
34 | //physics
35 | physicsBody = SKPhysicsBody(circleOfRadius: size.width / 2 - 1)
36 | physicsBody?.allowsRotation = false
37 | physicsBody?.categoryBitMask = ColliderType.Enemy.rawValue
38 | physicsBody?.contactTestBitMask = ColliderType.Player.rawValue | ColliderType.Bullet.rawValue
39 |
40 | }
41 |
42 | convenience init(position: CGPoint) {
43 | self.init()
44 | self.position = position
45 | }
46 |
47 | // Move the Enemy to a Tile
48 | func moveToTile(tile: Tile) {
49 |
50 | let newX = tile.position.x + self.size.width / 2
51 | let newY = tile.position.y + self.size.height / 2
52 | let newLocation = CGPoint(x: newX, y: newY)
53 | let moveAction = SKAction.moveTo(newLocation, duration: 1)
54 |
55 | runAction(moveAction)
56 | }
57 | }
--------------------------------------------------------------------------------
/get-out.xcodeproj/project.xcworkspace/xcshareddata/get-out.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | B2FBC38B-CBA9-4558-A725-D7FB0C2B3F25
9 | IDESourceControlProjectName
10 | get-out
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | E1DF98958E8FB6663BC06C29286555E4DE392B7E
14 | http://github.com/CorPruijs/get-out
15 |
16 | IDESourceControlProjectPath
17 | get-out.xcodeproj
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | E1DF98958E8FB6663BC06C29286555E4DE392B7E
21 | ../..
22 |
23 | IDESourceControlProjectURL
24 | http://github.com/CorPruijs/get-out
25 | IDESourceControlProjectVersion
26 | 111
27 | IDESourceControlProjectWCCIdentifier
28 | E1DF98958E8FB6663BC06C29286555E4DE392B7E
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | E1DF98958E8FB6663BC06C29286555E4DE392B7E
36 | IDESourceControlWCCName
37 | get-out
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/get-out/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/get-out/DebugOverlay.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DebugOverlay.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 07-10-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | class DebugOverlay {
12 | let sprite = SKSpriteNode()
13 | let background: SKSpriteNode
14 | let size : CGSize
15 | var debugLabels : [DebugLabel] = []
16 |
17 | var hidden = false
18 |
19 | // don't use this initializer
20 | init() {
21 | self.size = CGSize(width: 0, height: 0)
22 | background = SKSpriteNode()
23 | }
24 |
25 | // use this initializer
26 | init(size: CGSize) {
27 | self.size = size
28 | background = SKSpriteNode(color: UIColor(red: 0.043, green: 0.094, blue: 0.247, alpha: 0.2), size: CGSize(width: size.width, height: 50))
29 | background.position.y = (size.height / 2) - (background.size.height / 2)
30 | sprite.addChild(background)
31 | generateDebugLabels()
32 | addDebugLabels()
33 | sprite.hidden = hidden
34 | }
35 |
36 | func generateDebugLabels() {
37 | for index in 0...2 {
38 | let newLabel = DebugLabel(position: CGPoint(x: -(self.size.width / 2), y: ((self.size.height / 2) - (16 * CGFloat(index)))))
39 |
40 |
41 | // this is kinda hacky... will think of a better solution.
42 | // this might very well be the worst code i'll ever write, (combining a for loop and a switch), but i'm tired and i want this to work.
43 |
44 | switch index {
45 | case 0:
46 | newLabel.name = "x"
47 | case 1:
48 | newLabel.name = "y"
49 | case 2:
50 | newLabel.name = "player alive"
51 | default:
52 | println("invalid index at generate debuglabels")
53 | }
54 |
55 |
56 | debugLabels.append(newLabel)
57 |
58 | }
59 | }
60 |
61 | func addDebugLabels() {
62 | for label in debugLabels {
63 | sprite.addChild(label.label)
64 | }
65 | }
66 |
67 | // show / hide the overlay
68 | func toggle() {
69 | hidden = !hidden
70 | sprite.hidden = hidden
71 | }
72 | }
--------------------------------------------------------------------------------
/get-out/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 06-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/Weapon.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Weapon.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 23-10-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 |
12 | class Weapon: SubclassNode {
13 |
14 | let positionAtDirection: [Direction : CGPoint] = [.North : CGPoint(x: 0, y: 32), .East : CGPoint(x: 32, y: 0), .South : CGPoint(x: 0, y: -32), .West : CGPoint(x: -32, y: 0)]
15 | let speedmultiplier: CGFloat = 10
16 | let timeUntillDespawn: NSTimeInterval = 2
17 | let bulletAction: SKAction
18 | let shootDelay: NSTimeInterval = 0.2
19 |
20 | var previousTime = NSDate.timeIntervalSinceReferenceDate()
21 |
22 |
23 | override init() {
24 |
25 | // despawnAction
26 | let waitAction = SKAction.waitForDuration(timeUntillDespawn)
27 | let removeAction = SKAction.removeFromParent()
28 | bulletAction = SKAction.sequence([waitAction, removeAction])
29 |
30 | super.init(texture: nil, color: nil, size: CGSize())
31 | }
32 |
33 | func shoot(#direction: CGVector) {
34 |
35 |
36 | if NSDate.timeIntervalSinceReferenceDate() > previousTime + shootDelay {
37 |
38 | let bullet = SKSpriteNode(color: UIColor.redColor(), size: CGSize(width: 2, height: 2))
39 | bullet.name = "bullet"
40 |
41 | //position
42 | if let bulletDirection = directionfromVector(direction) {
43 | if let boost = positionAtDirection[bulletDirection] {
44 | bullet.position.x = parent!.position.x + boost.x
45 | bullet.position.y = parent!.position.y + boost.y
46 | }
47 | }
48 | bullet.zPosition = 100
49 |
50 | bullet.physicsBody = SKPhysicsBody(rectangleOfSize: bullet.size)
51 | bullet.physicsBody?.mass *= 100
52 |
53 | //velocity
54 | bullet.physicsBody?.velocity = direction
55 | bullet.physicsBody?.velocity.dx *= speedmultiplier
56 | bullet.physicsBody?.velocity.dy *= speedmultiplier
57 |
58 | bullet.runAction(bulletAction)
59 |
60 | parent?.parent?.addChild(bullet)
61 |
62 | previousTime = NSDate.timeIntervalSinceReferenceDate()
63 | }
64 |
65 |
66 |
67 | }
68 | }
69 |
70 |
--------------------------------------------------------------------------------
/get-out/GameViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GameViewController.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 06-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SpriteKit
11 |
12 | extension SKNode {
13 | class func unarchiveFromFile(file : NSString) -> SKNode? {
14 | if let path = NSBundle.mainBundle().pathForResource(file, ofType: "sks") {
15 | var sceneData = NSData(contentsOfFile: path, options: .DataReadingMappedIfSafe, error: nil)
16 | var archiver = NSKeyedUnarchiver(forReadingWithData: sceneData!)
17 |
18 | archiver.setClass(self.classForKeyedUnarchiver(), forClassName: "SKScene")
19 | let scene = archiver.decodeObjectForKey(NSKeyedArchiveRootObjectKey) as GameScene
20 | archiver.finishDecoding()
21 | return scene
22 | } else {
23 | return nil
24 | }
25 | }
26 | }
27 |
28 | class GameViewController: UIViewController {
29 |
30 | override func viewDidLoad() {
31 | super.viewDidLoad()
32 |
33 |
34 | if let scene = GameScene.unarchiveFromFile("GameScene") as? GameScene {
35 |
36 | //MARK: developer on / off
37 | let enableDevstuff = false
38 |
39 | // Configure the view.
40 | let skView = self.view as SKView
41 | skView.showsFPS = enableDevstuff
42 | skView.showsNodeCount = enableDevstuff
43 |
44 | /* Sprite Kit applies additional optimizations to improve rendering performance */
45 | skView.ignoresSiblingOrder = true
46 |
47 | /* Set the scale mode to scale to fit the window */
48 | scene.scaleMode = .ResizeFill
49 |
50 |
51 | skView.presentScene(scene)
52 | }
53 | }
54 |
55 |
56 | override func shouldAutorotate() -> Bool {
57 | return true
58 | }
59 |
60 | override func supportedInterfaceOrientations() -> Int {
61 | if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
62 | return Int(UIInterfaceOrientationMask.AllButUpsideDown.rawValue)
63 | } else {
64 | return Int(UIInterfaceOrientationMask.All.rawValue)
65 | }
66 | }
67 |
68 | override func didReceiveMemoryWarning() {
69 | super.didReceiveMemoryWarning()
70 | // Release any cached data, images, etc that aren't in use.
71 | }
72 |
73 | override func prefersStatusBarHidden() -> Bool {
74 | return true
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/get-out/Joystick.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Joystick.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 19-10-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | class Joystick: SubclassNode {
12 |
13 |
14 | var vector : CGVector? // this is the "Output" of the Joystick
15 | var startTouch : UITouch? // the touch that is currently on the Joystick
16 |
17 | private let disabledAlpha: CGFloat = 0.2
18 | private let enabledAlpha: CGFloat = 1
19 |
20 | // MARK: Initializers
21 |
22 | // don't use this one (the initialization part of this class needs some improvement)
23 | override init() {
24 |
25 | super.init(texture: nil, color: nil, size: CGSize())
26 | texture = SKTexture(imageNamed: "joystick_move")
27 | texture?.filteringMode = .Nearest
28 | size = CGSize(width: 128, height: 128)
29 | }
30 |
31 | // do use this one
32 | convenience init(imageNamed imageName: String, position: CGPoint, name: String) {
33 | self.init()
34 | // sprite setup
35 | self.texture = SKTexture(imageNamed: imageName)
36 | self.texture?.filteringMode = .Nearest
37 | self.name = name
38 | self.position = position
39 | self.alpha = disabledAlpha
40 |
41 | }
42 |
43 |
44 | // MARK: Control updates
45 | func startControl(touch: UITouch, location: CGPoint) {
46 |
47 | // keep track of touch
48 | startTouch = touch
49 |
50 | // update vector
51 | let dx = location.x - position.x
52 | let dy = location.y - position.y
53 | vector = CGVector(dx: dx, dy: dy)
54 |
55 | // update alpha
56 | alpha = enabledAlpha
57 | }
58 |
59 | func updateControl(newLocation: CGPoint) {
60 |
61 | // update vector
62 | let dx = newLocation.x - position.x
63 | let dy = newLocation.y - position.y
64 | vector = CGVector(dx: dx, dy: dy)
65 |
66 | // If the finger is moved outside the joystick, use the maximum value
67 | if vector!.dx > +(self.size.width / 2) {
68 | vector!.dx = +(self.size.width / 2)
69 | }
70 |
71 | if vector!.dx < -(self.size.width / 2) {
72 | vector!.dx = -(self.size.width / 2)
73 | }
74 |
75 | if vector!.dy > +(self.size.height / 2) {
76 | vector!.dy = +(self.size.height / 2)
77 | }
78 |
79 | if vector!.dy < -(self.size.height / 2) {
80 | vector!.dy = -(self.size.height / 2)
81 | }
82 | }
83 |
84 | func endControl() {
85 | startTouch = nil
86 | vector = nil
87 |
88 | // update alpha
89 | alpha = disabledAlpha
90 | }
91 |
92 | }
--------------------------------------------------------------------------------
/get-out/AnimationActionsFactory.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnimationActionsFactory.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 19-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 |
12 | // class that generates animation SKActions at initialization and exports them using getActions()
13 | class AnimationActionsFactory {
14 | var walkingFramesAtlas = SKTextureAtlas(named: "WalkImages")
15 | var walkingFrames: [Direction:[SKTexture]] = [:]
16 | var walkingFramesActions: [Direction:SKAction] = [:]
17 | init() {
18 | importWalkingFrames()
19 | createActionsFromFrames()
20 | }
21 |
22 | private func importWalkingFrames() {
23 |
24 | var tempWalkingFrames: [SKTexture] = []
25 | let imagesCount = walkingFramesAtlas.textureNames.count / 3
26 |
27 | for index in 1...imagesCount {
28 | let textureName = "player_walk_north_\(index)"
29 | let tempTexture = walkingFramesAtlas.textureNamed(textureName)
30 | tempTexture.filteringMode = .Nearest
31 | tempWalkingFrames.append(tempTexture)
32 | }
33 | self.walkingFrames[Direction.North] = tempWalkingFrames
34 |
35 |
36 | tempWalkingFrames = []
37 | for index in 1...imagesCount {
38 | let textureName = "player_walk_east_\(index)"
39 | let tempTexture = walkingFramesAtlas.textureNamed(textureName)
40 | tempTexture.filteringMode = .Nearest
41 | tempWalkingFrames.append(tempTexture)
42 | }
43 | self.walkingFrames[Direction.East] = tempWalkingFrames
44 |
45 |
46 | tempWalkingFrames = []
47 | for index in 1...imagesCount {
48 | let textureName = "player_walk_south_\(index)"
49 | let tempTexture = walkingFramesAtlas.textureNamed(textureName)
50 | tempTexture.filteringMode = .Nearest
51 | tempWalkingFrames.append(tempTexture)
52 | }
53 | self.walkingFrames[Direction.South] = tempWalkingFrames
54 |
55 |
56 | tempWalkingFrames = []
57 | for index in 1...imagesCount {
58 | let textureName = "player_walk_west_\(index)"
59 | let tempTexture = walkingFramesAtlas.textureNamed(textureName)
60 | tempTexture.filteringMode = .Nearest
61 | tempWalkingFrames.append(tempTexture)
62 | }
63 | self.walkingFrames[Direction.West] = tempWalkingFrames
64 | }
65 |
66 |
67 | //create SKAction animations from the walkingFrames Dictionary and put them in the walkingFramesActions Dictionary
68 | private func createActionsFromFrames() {
69 |
70 | // All Direction values that have animations
71 | let directionList = [Direction.North, Direction.East, Direction.South, Direction.West]
72 |
73 | for direction in directionList {
74 | let animateAction = SKAction.animateWithTextures(walkingFrames[direction]!, timePerFrame: 0.1, resize: false, restore: true)
75 | let repeatedAction = SKAction.repeatActionForever(animateAction)
76 | walkingFramesActions[direction] = repeatedAction
77 | }
78 |
79 | }
80 |
81 | func getActions() -> [Direction:SKAction] {
82 | return walkingFramesActions
83 | }
84 | }
--------------------------------------------------------------------------------
/get-out/Tile.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Tile.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 14-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | class Tile: SubclassNode {
12 |
13 | var gridPosition: GridPoint = GridPoint(x: 0, y: 0)
14 | var textureName: String = "tile_floor"
15 |
16 |
17 | // MARK: Public Initializers
18 | convenience init(tileDefinition: TileDefinition) {
19 | self.init(textureName: tileDefinition.textureName, collides: tileDefinition.collides)
20 | }
21 |
22 | convenience init(tileDefinition: TileDefinition, gridPosition: GridPoint) {
23 | self.init(tileDefinition: tileDefinition)
24 | self.gridPosition = gridPosition
25 | updatePosition()
26 | }
27 |
28 | //MARK: private initializers
29 | override init() {
30 |
31 | super.init(texture: nil, color: nil, size: CGSize())
32 |
33 | //sprite configuration
34 | name = "tile"
35 | size = CGSize(width: 64, height: 64)
36 | texture = SKTexture(imageNamed: textureName)
37 | texture?.filteringMode = .Nearest
38 | anchorPoint = CGPoint(x: 0, y: 0)
39 |
40 | //position
41 | gridPosition = GridPoint(x: 0, y: 0)
42 |
43 |
44 | updatePosition()
45 | updateTexture()
46 | }
47 |
48 | private convenience init(gridPosition: GridPoint){
49 | self.init()
50 | self.gridPosition = gridPosition
51 | updatePosition()
52 | }
53 |
54 | private convenience init(textureName: String) {
55 | self.init()
56 | self.textureName = textureName
57 | updateTexture()
58 | }
59 |
60 | private convenience init(textureName: String, collides: Bool) {
61 | self.init(textureName: textureName)
62 | if collides {
63 | self.enableCollisions()
64 | }
65 |
66 | }
67 |
68 | private convenience init(textureName: String, gridPosition: GridPoint) {
69 | self.init()
70 | self.textureName = textureName
71 | self.gridPosition = gridPosition
72 | updateTexture()
73 | updatePosition()
74 | }
75 |
76 | private convenience init(textureName: String, gridPosition: GridPoint, collides: Bool) {
77 | self.init(textureName: textureName, gridPosition: gridPosition)
78 | if collides {
79 | self.enableCollisions()
80 | }
81 | }
82 |
83 | //MARK: Update functions
84 |
85 | // Update actual position to represent grid position
86 | func updatePosition() {
87 | let newX = CGFloat(gridPosition.x) * size.width
88 | let newY = CGFloat(gridPosition.y) * size.height
89 | let newPosition = CGPoint(x: newX, y: newY)
90 | position = newPosition
91 | }
92 |
93 | // Update actual image to represent imageName
94 | func updateTexture() {
95 | texture = SKTexture(imageNamed: textureName)
96 | texture?.filteringMode = SKTextureFilteringMode.Nearest
97 | }
98 |
99 |
100 | // Add a PhysicsBody to the sprite in order to use collisions.
101 | func enableCollisions() {
102 |
103 | // Anchor point adjustments
104 | let newX = CGFloat(0.5 * self.size.width)
105 | let newY = CGFloat(0.5 * self.size.height)
106 | let center = CGPoint(x: newX, y: newY)
107 |
108 | physicsBody = SKPhysicsBody(rectangleOfSize: size, center: center)
109 | physicsBody?.dynamic = false
110 |
111 | }
112 | }
--------------------------------------------------------------------------------
/get-out.xcodeproj/xcuserdata/cor.xcuserdatad/xcschemes/get-out.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
94 |
100 |
101 |
102 |
103 |
105 |
106 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/get-out/Player.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Player.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 14-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 |
12 | class Player: SubclassNode {
13 |
14 | // MARK: Textures and animations
15 | let idleTexture = SKTexture(imageNamed: "player")
16 | let animationActionsFactory = AnimationActionsFactory()
17 | let walkingFramesActions: [Direction:SKAction]
18 |
19 | // MARK: Speed values
20 | let slowDownMultiplier: CGFloat = 0.7
21 | let speedMultiplier: CGFloat = 3
22 | var slowDownEnabled: Bool = true
23 |
24 | // MARK: current values
25 | var currentGridPosition: CGPoint = CGPoint()
26 | var currentTile: Tile?
27 | var currentDirection: Direction? = nil
28 | var currentAnimation: Direction? = nil
29 |
30 | // stats
31 | var health: Int = 100
32 |
33 | var isAlive: Bool {
34 | return health > 0
35 | }
36 |
37 | var currentWeapon: Weapon? {
38 |
39 | willSet {
40 | // remove current weapon sprite
41 | if currentWeapon != nil {
42 | self.currentWeapon!.removeFromParent()
43 | }
44 | }
45 |
46 | didSet {
47 | // add weapon sprite to player sprite
48 | if currentWeapon != nil {
49 | self.addChild(currentWeapon!)
50 | }
51 | }
52 | }
53 |
54 | // MARK: Initializers
55 |
56 | override init() {
57 |
58 | walkingFramesActions = animationActionsFactory.getActions()
59 |
60 | super.init(texture: nil, color: nil, size: CGSize())
61 |
62 | //sprite configuration
63 | name = "player"
64 | size = CGSize(width: 64, height: 64)
65 | texture = SKTexture(imageNamed: "player")
66 | texture?.filteringMode = .Nearest
67 |
68 | //position
69 | zPosition = 100
70 | currentGridPosition = CGPoint()
71 | currentTile = Tile()
72 |
73 | //physicis
74 | physicsBody = SKPhysicsBody(circleOfRadius: size.width / 2 - 1)
75 | physicsBody?.allowsRotation = false
76 | physicsBody?.categoryBitMask = ColliderType.Player.rawValue
77 | physicsBody?.contactTestBitMask = ColliderType.Enemy.rawValue | ColliderType.Bullet.rawValue
78 |
79 | //weapon configuration
80 | currentWeapon = Weapon()
81 | addChild(currentWeapon!)
82 |
83 | }
84 |
85 | convenience init(position: CGPoint) {
86 | self.init()
87 | self.position = position
88 | }
89 |
90 |
91 | // Move the player to a Tile
92 | func moveToTile(tile: Tile) {
93 |
94 | let newX = tile.position.x + self.size.width / 2
95 | let newY = tile.position.y + self.size.height / 2
96 | let newLocation = CGPoint(x: newX, y: newY)
97 | let moveAction = SKAction.moveTo(newLocation, duration: 1)
98 |
99 | runAction(moveAction)
100 | }
101 |
102 | //Update Sprite to use the corerct animation from walkingFramesActions[:]
103 | private func updateAnimation() {
104 |
105 | func stopAnimation() {
106 | removeActionForKey("playerMoving")
107 | texture = idleTexture
108 | }
109 |
110 | let velocity = physicsBody?.velocity
111 | let direction = directionfromVector(velocity!)
112 |
113 | if direction != currentAnimation {
114 | if direction != nil {
115 | runAction(self.walkingFramesActions[direction!]!, withKey: "playerMoving")
116 | currentAnimation = direction
117 | }
118 | else {
119 | currentAnimation = nil
120 | stopAnimation()
121 | }
122 | }
123 |
124 | }
125 |
126 | func update(#inputMove: CGVector?, inputShoot: CGVector?) {
127 |
128 | move(vector: inputMove)
129 |
130 | if inputShoot != nil {
131 | shoot(vector: inputShoot!)
132 | }
133 |
134 | updateAnimation()
135 | updateCurrentGridPosition()
136 |
137 | }
138 |
139 | // moves the player by a vector, uses the speedMultiplier property
140 | func move(#vector: CGVector?) {
141 | if vector != nil {
142 | physicsBody?.velocity.dx = vector!.dx * speedMultiplier
143 | physicsBody?.velocity.dy = vector!.dy * speedMultiplier
144 | } else {
145 | if slowDownEnabled {
146 | physicsBody?.velocity.dx *= slowDownMultiplier
147 | physicsBody?.velocity.dy *= slowDownMultiplier
148 | }
149 | }
150 | }
151 |
152 | func shoot(#vector: CGVector) {
153 |
154 | if let weapon = currentWeapon {
155 | weapon.shoot(direction: vector)
156 | }
157 |
158 | }
159 |
160 | private func updateCurrentGridPosition() {
161 | var position = self.position
162 |
163 | // adjust position to represent feet
164 | position.x += 64
165 | position.y += 32
166 |
167 | var gridPoint = CGPoint(x: Int(position.x / 64) - 1, y: Int(position.y / 64) - 1)
168 |
169 | currentGridPosition = gridPoint
170 | }
171 |
172 | }
--------------------------------------------------------------------------------
/get-out/GameScene.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GameScene.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 06-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 |
12 | class GameScene: SKScene, SKPhysicsContactDelegate {
13 |
14 | let world = World(fileNamed: "levels/1")
15 |
16 | var joystickMove = Joystick()
17 | var joystickShoot = Joystick()
18 | var debugOverlay = DebugOverlay()
19 | var healthBar = HealthBar()
20 |
21 |
22 | override func didMoveToView(view: SKView) {
23 |
24 | //view settings
25 | self.physicsWorld.gravity = CGVector(dx: 0, dy: 0)
26 | self.anchorPoint = CGPoint(x: 0.5, y: 0.5)
27 |
28 | //world
29 | self.physicsWorld.contactDelegate = world
30 | self.addChild(world)
31 |
32 | //debug overlay
33 | debugOverlay = DebugOverlay(size: self.frame.size)
34 | self.addChild(debugOverlay.sprite)
35 | debugOverlay.toggle()
36 |
37 | //joystick move
38 | let joystickMovePosition = CGPoint(x: -(self.size.width / 2) + (joystickMove.size.width / 2), y: -(self.size.height / 2) + (joystickMove.size.height / 2) )
39 | joystickMove = Joystick(imageNamed: "joystick_move", position: joystickMovePosition, name: "joystickMove")
40 | self.addChild(joystickMove)
41 |
42 | //joystick shoot
43 | let joystickShootPosition = CGPoint(x: +(self.size.width / 2) - (joystickShoot.size.width / 2), y: -(self.size.height / 2) + (joystickMove.size.height / 2) )
44 | joystickShoot = Joystick(imageNamed: "joystick_shoot", position: joystickShootPosition, name: "joystickShoot")
45 | self.addChild(joystickShoot)
46 |
47 | //health bar
48 | healthBar.position = CGPoint(x: -(self.size.width / 2), y: +(self.size.height / 2))
49 | self.addChild(healthBar)
50 |
51 | }
52 |
53 | // MARK: input
54 | override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
55 |
56 |
57 | for touch: AnyObject in touches {
58 |
59 | let touchedLocation: CGPoint = touch.locationInNode(self)
60 | let touchedNode: SKNode = self.nodeAtPoint(touchedLocation)
61 |
62 | if touchedNode.name == "joystickMove" {
63 | joystickMove.startControl(touch as UITouch, location: touchedLocation)
64 | }
65 |
66 | if touchedNode.name == "joystickShoot" {
67 | joystickShoot.startControl(touch as UITouch, location: touchedLocation)
68 | }
69 | }
70 |
71 | //toggle debugoverlay if three fingers are pressed at the top of the screen
72 | if touches.count == 3 {
73 |
74 | var goingToEnable = true
75 |
76 | for touch: AnyObject in touches {
77 | let touchLocation = touch.locationInNode!(self)
78 | if touchLocation.y < ( self.size.height / 2) - ( debugOverlay.background.size.height) {
79 | goingToEnable = false
80 | }
81 | }
82 |
83 | if goingToEnable {
84 | debugOverlay.toggle()
85 | }
86 | }
87 |
88 | }
89 |
90 | override func touchesMoved(touches: NSSet, withEvent event: UIEvent) {
91 | for touch: AnyObject in touches {
92 |
93 | // update joysticks
94 | if touch as? UITouch == joystickMove.startTouch {
95 | let touchLocation = touch.locationInNode!(self)
96 | joystickMove.updateControl(touchLocation)
97 | }
98 |
99 | if touch as? UITouch == joystickShoot.startTouch {
100 | let touchLocation = touch.locationInNode!(self)
101 | joystickShoot.updateControl(touchLocation)
102 | }
103 |
104 | }
105 | }
106 |
107 | override func touchesEnded(touches: NSSet, withEvent event: UIEvent) {
108 | for touch: AnyObject in touches {
109 |
110 | // update joysticks
111 | if touch as? UITouch == joystickMove.startTouch {
112 | joystickMove.endControl()
113 | }
114 |
115 | if touch as? UITouch == joystickShoot.startTouch {
116 | joystickShoot.endControl()
117 | }
118 | }
119 | }
120 |
121 |
122 | override func update(currentTime: CFTimeInterval) {
123 |
124 |
125 | self.updateDebugLabels()
126 | world.update()
127 | world.player.update(inputMove: joystickMove.vector, inputShoot: joystickShoot.vector)
128 | updateUI()
129 |
130 | }
131 |
132 | func updateUI() {
133 | healthBar.setHealth(world.player.health)
134 | }
135 |
136 |
137 | // FIXME:
138 | func updateDebugLabels() {
139 | for label in debugOverlay.debugLabels {
140 | label.update("\(world.player.position.x)")
141 |
142 | switch label.name {
143 | case "x":
144 | label.update("\(Int(world.player.position.x))")
145 | case "y":
146 | label.update("\(Int(world.player.position.y))")
147 | case "player alive":
148 | label.update("\(world.player.isAlive)")
149 | default:
150 | println("invalid label name, by the way you should remove this dumb for-switch combination")
151 | }
152 | }
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/get-out/World.swift:
--------------------------------------------------------------------------------
1 | //
2 | // World.swift
3 | // get-out
4 | //
5 | // Created by Cor Pruijs on 23-09-14.
6 | // Copyright (c) 2014 Cor Pruijs. All rights reserved.
7 | //
8 |
9 | import SpriteKit
10 |
11 | class World: SubclassNode, SKPhysicsContactDelegate {
12 |
13 | // MARK: Private properties
14 | private var tiles: [Tile] = []
15 | private let mapSize = CGSize(width: 10, height: 10)
16 |
17 | // MARK: Public properties
18 | let tileFactory = TileFactory()
19 | let camera = Camera()
20 | let player: Player
21 |
22 | let enemy: Enemy
23 |
24 | // MARK: Initialization
25 | override init() {
26 |
27 |
28 | player = Player()
29 | enemy = Enemy(position: CGPoint(x: 64, y: 64))
30 | super.init(texture: nil, color: UIColor.redColor(), size: CGSize(width: mapSize.width * 64, height: mapSize.height * 64))
31 |
32 | //world setup
33 | name = "world"
34 |
35 | player.position = CGPoint(x: size.width / 2, y: size.height / 2)
36 | anchorPoint = CGPoint(x:0, y:0)
37 | zPosition = -100
38 | physicsBody = SKPhysicsBody(edgeLoopFromRect: self.frame)
39 |
40 |
41 | addTiles()
42 | addChild(player)
43 | addChild(camera)
44 | addChild(enemy)
45 |
46 |
47 | }
48 |
49 | // load level from text file
50 | convenience init(fileNamed fileName: String) {
51 | self.init()
52 |
53 | // delete default tiles
54 | for tile in tiles {
55 | tile.removeFromParent()
56 | }
57 | tiles = []
58 |
59 |
60 | // FIXME
61 | if let filePath = NSBundle.mainBundle().pathForResource(fileName, ofType: "txt") {
62 |
63 | if let testString = String(contentsOfFile: filePath, encoding: NSUTF8StringEncoding, error: nil) {
64 |
65 | // split lines of level
66 | let stringArray = testString.componentsSeparatedByString("\n")
67 |
68 | var lineIndex = 0
69 |
70 | for var index = stringArray.count - 1; index >= 0; index-- {
71 |
72 | var indexInLine = 0
73 |
74 | for character in stringArray[index] {
75 |
76 | let position = GridPoint(x: indexInLine, y: lineIndex)
77 | if character == "O" {
78 | let tile = Tile(tileDefinition: tileFactory.tileDefinitions["floor"]!, gridPosition: position)
79 | tiles.append(tile)
80 | } else if character == "X" {
81 | let tile = Tile(tileDefinition: tileFactory.tileDefinitions["wall"]!, gridPosition: position)
82 | tiles.append(tile)
83 | }
84 |
85 | ++indexInLine
86 |
87 | }
88 |
89 | ++lineIndex
90 | }
91 |
92 | }
93 | }
94 | // Add tiles from the tiles array to the scene
95 | for tile in tiles {
96 | tile.zPosition = 10
97 | addChild(tile)
98 | }
99 |
100 | }
101 |
102 | private func addTiles() {
103 |
104 | // Create new tiles and add them to the tiles array
105 | for horizontalTileRow in 0.. Tile? {
140 | let possibleTileIndex = (y * Int(mapSize.width)) + x
141 |
142 | if !(possibleTileIndex < 0 || possibleTileIndex > (tiles.count - 1)) {
143 | return tiles[possibleTileIndex]
144 | } else {
145 | return nil
146 | }
147 |
148 | }
149 |
150 | //return optional tile from gridPoint
151 | func getTile(#gridPoint: GridPoint) -> Tile? {
152 | let possibleTileIndex = gridPoint.y * Int(mapSize.width) + gridPoint.x
153 | if !(possibleTileIndex < 0 || possibleTileIndex > (tiles.count - 1)) {
154 | return tiles[possibleTileIndex]
155 | }
156 | else {
157 | return nil
158 | }
159 | }
160 |
161 | func setTile(#gridPoint: GridPoint, tile: Tile) {
162 | let possibleTileIndex = gridPoint.y * Int(mapSize.width) + Int(gridPoint.x)
163 | if !(possibleTileIndex < 0 || possibleTileIndex > (tiles.count - 1)) {
164 | tiles[possibleTileIndex].removeFromParent()
165 | tiles[possibleTileIndex] = tile
166 | addChild(tiles[possibleTileIndex])
167 | }
168 | }
169 |
170 | func update() {
171 | camera.position = player.position
172 | camera.centerOnNode(camera)
173 |
174 | }
175 | }
176 |
--------------------------------------------------------------------------------
/get-out.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 870A6A7219C71E16001A2ABE /* WalkImages.atlas in Resources */ = {isa = PBXBuildFile; fileRef = 870A6A7119C71E16001A2ABE /* WalkImages.atlas */; };
11 | 870A6A7619C72193001A2ABE /* tile_floor.png in Resources */ = {isa = PBXBuildFile; fileRef = 870A6A7519C72193001A2ABE /* tile_floor.png */; };
12 | 87262AA919C830760052C448 /* player.png in Resources */ = {isa = PBXBuildFile; fileRef = 87262AA819C830760052C448 /* player.png */; };
13 | 87284FD319F98FE00050ACBC /* Weapon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87284FD219F98FE00050ACBC /* Weapon.swift */; };
14 | 8734316119BB74C400050D5B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8734316019BB74C400050D5B /* AppDelegate.swift */; };
15 | 8734316319BB74C400050D5B /* GameScene.sks in Resources */ = {isa = PBXBuildFile; fileRef = 8734316219BB74C400050D5B /* GameScene.sks */; };
16 | 8734316519BB74C400050D5B /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8734316419BB74C400050D5B /* GameScene.swift */; };
17 | 8734316719BB74C400050D5B /* GameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8734316619BB74C400050D5B /* GameViewController.swift */; };
18 | 8734316A19BB74C400050D5B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8734316819BB74C400050D5B /* Main.storyboard */; };
19 | 8734316C19BB74C400050D5B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8734316B19BB74C400050D5B /* Images.xcassets */; };
20 | 8734317819BB74C400050D5B /* get_outTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8734317719BB74C400050D5B /* get_outTests.swift */; };
21 | 8734572C19FD94EF008EA491 /* levels in Resources */ = {isa = PBXBuildFile; fileRef = 8734572B19FD94EF008EA491 /* levels */; };
22 | 8739812719E736BC00466482 /* joystick_move.png in Resources */ = {isa = PBXBuildFile; fileRef = 8739812619E736BC00466482 /* joystick_move.png */; };
23 | 8739812919E73ABD00466482 /* button.png in Resources */ = {isa = PBXBuildFile; fileRef = 8739812819E73ABD00466482 /* button.png */; };
24 | 8739812B19E73BD900466482 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8739812A19E73BD900466482 /* Button.swift */; };
25 | 87520D8419FC67EA0041B8CF /* Collisions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87520D8319FC67EA0041B8CF /* Collisions.swift */; };
26 | 876041C919FD3BA20027ADE5 /* SubclassNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 876041C819FD3BA20027ADE5 /* SubclassNode.swift */; };
27 | 87694B1619D20FF90083C2E7 /* World.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87694B1519D20FF90083C2E7 /* World.swift */; };
28 | 87694B1819D212C60083C2E7 /* Camera.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87694B1719D212C60083C2E7 /* Camera.swift */; };
29 | 876DD9FC19E43AAF004FE675 /* DebugOverlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 876DD9FB19E43AAF004FE675 /* DebugOverlay.swift */; };
30 | 87704FCF19E42A3000AC782F /* TileFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87704FCE19E42A3000AC782F /* TileFactory.swift */; };
31 | 878CF4B119F9849D00336E0F /* joystick_shoot.png in Resources */ = {isa = PBXBuildFile; fileRef = 878CF4B019F9849D00336E0F /* joystick_shoot.png */; };
32 | 878FE39419C5AA8A00E3DA63 /* Tile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 878FE39319C5AA8A00E3DA63 /* Tile.swift */; };
33 | 87A441DE19E6C47600AC4970 /* Enemy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87A441DD19E6C47600AC4970 /* Enemy.swift */; };
34 | 87B6E5D819D8B31D00CDB949 /* LocationLogic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87B6E5D719D8B31D00CDB949 /* LocationLogic.swift */; };
35 | 87B779E11A0252CC00323172 /* Healthbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87B779E01A0252CC00323172 /* Healthbar.swift */; };
36 | 87B779E31A025FE900323172 /* healthbar.png in Resources */ = {isa = PBXBuildFile; fileRef = 87B779E21A025FE900323172 /* healthbar.png */; };
37 | 87C280CF19CC90B200CED293 /* AnimationActionsFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87C280CE19CC90B200CED293 /* AnimationActionsFactory.swift */; };
38 | 87C8B36219FBB757006F6D54 /* enemy.png in Resources */ = {isa = PBXBuildFile; fileRef = 87C8B36119FBB757006F6D54 /* enemy.png */; };
39 | 87C9A20319F419D200A1D334 /* Joystick.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87C9A20219F419D200A1D334 /* Joystick.swift */; };
40 | 87D6422019C5EA3600A12784 /* Player.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87D6421F19C5EA3600A12784 /* Player.swift */; };
41 | 87D93FD519D580D5000C2825 /* tile_example.png in Resources */ = {isa = PBXBuildFile; fileRef = 87D93FD419D580D5000C2825 /* tile_example.png */; };
42 | 87DA76F819E09C0200B9D52C /* tile_wall.png in Resources */ = {isa = PBXBuildFile; fileRef = 87DA76F719E09C0200B9D52C /* tile_wall.png */; };
43 | 87E4A90919DB403600E522A3 /* DebugLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E4A90819DB403600E522A3 /* DebugLabel.swift */; };
44 | 87E4D24119D8B9CF00E4DE8C /* tile_floor_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 87E4D24019D8B9CF00E4DE8C /* tile_floor_selected.png */; };
45 | /* End PBXBuildFile section */
46 |
47 | /* Begin PBXContainerItemProxy section */
48 | 8734317219BB74C400050D5B /* PBXContainerItemProxy */ = {
49 | isa = PBXContainerItemProxy;
50 | containerPortal = 8734315319BB74C400050D5B /* Project object */;
51 | proxyType = 1;
52 | remoteGlobalIDString = 8734315A19BB74C400050D5B;
53 | remoteInfo = "get-out";
54 | };
55 | /* End PBXContainerItemProxy section */
56 |
57 | /* Begin PBXFileReference section */
58 | 870A6A7119C71E16001A2ABE /* WalkImages.atlas */ = {isa = PBXFileReference; lastKnownFileType = folder.skatlas; path = WalkImages.atlas; sourceTree = ""; };
59 | 870A6A7519C72193001A2ABE /* tile_floor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tile_floor.png; sourceTree = ""; };
60 | 87262AA819C830760052C448 /* player.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = player.png; sourceTree = ""; };
61 | 87284FD219F98FE00050ACBC /* Weapon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Weapon.swift; path = ../Weapon.swift; sourceTree = ""; };
62 | 8734315B19BB74C400050D5B /* get-out.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "get-out.app"; sourceTree = BUILT_PRODUCTS_DIR; };
63 | 8734315F19BB74C400050D5B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
64 | 8734316019BB74C400050D5B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
65 | 8734316219BB74C400050D5B /* GameScene.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = GameScene.sks; sourceTree = ""; };
66 | 8734316419BB74C400050D5B /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = ""; wrapsLines = 0; };
67 | 8734316619BB74C400050D5B /* GameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameViewController.swift; sourceTree = ""; };
68 | 8734316919BB74C400050D5B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
69 | 8734316B19BB74C400050D5B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
70 | 8734317119BB74C400050D5B /* get-outTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "get-outTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
71 | 8734317619BB74C400050D5B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
72 | 8734317719BB74C400050D5B /* get_outTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = get_outTests.swift; sourceTree = ""; };
73 | 8734572B19FD94EF008EA491 /* levels */ = {isa = PBXFileReference; lastKnownFileType = folder; path = levels; sourceTree = ""; };
74 | 8739812619E736BC00466482 /* joystick_move.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = joystick_move.png; sourceTree = ""; };
75 | 8739812819E73ABD00466482 /* button.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = button.png; sourceTree = ""; };
76 | 8739812A19E73BD900466482 /* Button.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = ""; };
77 | 87520D8319FC67EA0041B8CF /* Collisions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Collisions.swift; sourceTree = ""; };
78 | 876041C819FD3BA20027ADE5 /* SubclassNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubclassNode.swift; sourceTree = ""; };
79 | 87694B1519D20FF90083C2E7 /* World.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = World.swift; sourceTree = ""; };
80 | 87694B1719D212C60083C2E7 /* Camera.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Camera.swift; sourceTree = ""; };
81 | 876DD9FB19E43AAF004FE675 /* DebugOverlay.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DebugOverlay.swift; sourceTree = ""; };
82 | 87704FCE19E42A3000AC782F /* TileFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TileFactory.swift; sourceTree = ""; };
83 | 878CF4B019F9849D00336E0F /* joystick_shoot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = joystick_shoot.png; sourceTree = ""; };
84 | 878FE39319C5AA8A00E3DA63 /* Tile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tile.swift; sourceTree = ""; };
85 | 87A441DD19E6C47600AC4970 /* Enemy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Enemy.swift; sourceTree = ""; };
86 | 87B6E5D719D8B31D00CDB949 /* LocationLogic.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationLogic.swift; sourceTree = ""; };
87 | 87B779E01A0252CC00323172 /* Healthbar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Healthbar.swift; sourceTree = ""; };
88 | 87B779E21A025FE900323172 /* healthbar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = healthbar.png; sourceTree = ""; };
89 | 87C280CE19CC90B200CED293 /* AnimationActionsFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationActionsFactory.swift; sourceTree = ""; };
90 | 87C8B36119FBB757006F6D54 /* enemy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = enemy.png; sourceTree = ""; };
91 | 87C9A20219F419D200A1D334 /* Joystick.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Joystick.swift; sourceTree = ""; };
92 | 87D6421F19C5EA3600A12784 /* Player.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Player.swift; sourceTree = ""; };
93 | 87D93FD419D580D5000C2825 /* tile_example.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tile_example.png; sourceTree = ""; };
94 | 87DA76F719E09C0200B9D52C /* tile_wall.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tile_wall.png; sourceTree = ""; };
95 | 87E4A90819DB403600E522A3 /* DebugLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DebugLabel.swift; sourceTree = ""; };
96 | 87E4D24019D8B9CF00E4DE8C /* tile_floor_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tile_floor_selected.png; sourceTree = ""; };
97 | /* End PBXFileReference section */
98 |
99 | /* Begin PBXFrameworksBuildPhase section */
100 | 8734315819BB74C400050D5B /* Frameworks */ = {
101 | isa = PBXFrameworksBuildPhase;
102 | buildActionMask = 2147483647;
103 | files = (
104 | );
105 | runOnlyForDeploymentPostprocessing = 0;
106 | };
107 | 8734316E19BB74C400050D5B /* Frameworks */ = {
108 | isa = PBXFrameworksBuildPhase;
109 | buildActionMask = 2147483647;
110 | files = (
111 | );
112 | runOnlyForDeploymentPostprocessing = 0;
113 | };
114 | /* End PBXFrameworksBuildPhase section */
115 |
116 | /* Begin PBXGroup section */
117 | 8734315219BB74C400050D5B = {
118 | isa = PBXGroup;
119 | children = (
120 | 8734315D19BB74C400050D5B /* get-out */,
121 | 8734317419BB74C400050D5B /* get-outTests */,
122 | 8734315C19BB74C400050D5B /* Products */,
123 | );
124 | sourceTree = "";
125 | };
126 | 8734315C19BB74C400050D5B /* Products */ = {
127 | isa = PBXGroup;
128 | children = (
129 | 8734315B19BB74C400050D5B /* get-out.app */,
130 | 8734317119BB74C400050D5B /* get-outTests.xctest */,
131 | );
132 | name = Products;
133 | sourceTree = "";
134 | };
135 | 8734315D19BB74C400050D5B /* get-out */ = {
136 | isa = PBXGroup;
137 | children = (
138 | 8734572B19FD94EF008EA491 /* levels */,
139 | 87284FD219F98FE00050ACBC /* Weapon.swift */,
140 | 876041C819FD3BA20027ADE5 /* SubclassNode.swift */,
141 | 8734316419BB74C400050D5B /* GameScene.swift */,
142 | 876041CA19FD427F0027ADE5 /* World */,
143 | 87C8B36019FBB64C006F6D54 /* player */,
144 | 87C8B36319FBB75D006F6D54 /* enemy */,
145 | 87C8B35F19FBB4D8006F6D54 /* ui */,
146 | 8734315E19BB74C400050D5B /* Supporting Files */,
147 | 8734316B19BB74C400050D5B /* Images.xcassets */,
148 | 8734316019BB74C400050D5B /* AppDelegate.swift */,
149 | 8734316619BB74C400050D5B /* GameViewController.swift */,
150 | 8734316219BB74C400050D5B /* GameScene.sks */,
151 | 8734316819BB74C400050D5B /* Main.storyboard */,
152 | );
153 | path = "get-out";
154 | sourceTree = "";
155 | };
156 | 8734315E19BB74C400050D5B /* Supporting Files */ = {
157 | isa = PBXGroup;
158 | children = (
159 | 8734315F19BB74C400050D5B /* Info.plist */,
160 | );
161 | name = "Supporting Files";
162 | sourceTree = "";
163 | };
164 | 8734317419BB74C400050D5B /* get-outTests */ = {
165 | isa = PBXGroup;
166 | children = (
167 | 8734317719BB74C400050D5B /* get_outTests.swift */,
168 | 8734317519BB74C400050D5B /* Supporting Files */,
169 | );
170 | path = "get-outTests";
171 | sourceTree = "";
172 | };
173 | 8734317519BB74C400050D5B /* Supporting Files */ = {
174 | isa = PBXGroup;
175 | children = (
176 | 8734317619BB74C400050D5B /* Info.plist */,
177 | );
178 | name = "Supporting Files";
179 | sourceTree = "";
180 | };
181 | 876041CA19FD427F0027ADE5 /* World */ = {
182 | isa = PBXGroup;
183 | children = (
184 | 87694B1519D20FF90083C2E7 /* World.swift */,
185 | 87520D8319FC67EA0041B8CF /* Collisions.swift */,
186 | 87694B1719D212C60083C2E7 /* Camera.swift */,
187 | 87B6E5D719D8B31D00CDB949 /* LocationLogic.swift */,
188 | 87C8B35E19FBB4B9006F6D54 /* tiles */,
189 | );
190 | name = World;
191 | sourceTree = "";
192 | };
193 | 87C8B35E19FBB4B9006F6D54 /* tiles */ = {
194 | isa = PBXGroup;
195 | children = (
196 | 878FE39319C5AA8A00E3DA63 /* Tile.swift */,
197 | 87704FCE19E42A3000AC782F /* TileFactory.swift */,
198 | 87E4D24019D8B9CF00E4DE8C /* tile_floor_selected.png */,
199 | 87D93FD419D580D5000C2825 /* tile_example.png */,
200 | 870A6A7519C72193001A2ABE /* tile_floor.png */,
201 | 87DA76F719E09C0200B9D52C /* tile_wall.png */,
202 | );
203 | name = tiles;
204 | sourceTree = "";
205 | };
206 | 87C8B35F19FBB4D8006F6D54 /* ui */ = {
207 | isa = PBXGroup;
208 | children = (
209 | 87B779E01A0252CC00323172 /* Healthbar.swift */,
210 | 87B779E21A025FE900323172 /* healthbar.png */,
211 | 87C9A20219F419D200A1D334 /* Joystick.swift */,
212 | 8739812619E736BC00466482 /* joystick_move.png */,
213 | 878CF4B019F9849D00336E0F /* joystick_shoot.png */,
214 | 8739812A19E73BD900466482 /* Button.swift */,
215 | 8739812819E73ABD00466482 /* button.png */,
216 | 87E4A90819DB403600E522A3 /* DebugLabel.swift */,
217 | 876DD9FB19E43AAF004FE675 /* DebugOverlay.swift */,
218 | );
219 | name = ui;
220 | sourceTree = "";
221 | };
222 | 87C8B36019FBB64C006F6D54 /* player */ = {
223 | isa = PBXGroup;
224 | children = (
225 | 87D6421F19C5EA3600A12784 /* Player.swift */,
226 | 87C280CE19CC90B200CED293 /* AnimationActionsFactory.swift */,
227 | 87262AA819C830760052C448 /* player.png */,
228 | 870A6A7119C71E16001A2ABE /* WalkImages.atlas */,
229 | );
230 | name = player;
231 | sourceTree = "";
232 | };
233 | 87C8B36319FBB75D006F6D54 /* enemy */ = {
234 | isa = PBXGroup;
235 | children = (
236 | 87A441DD19E6C47600AC4970 /* Enemy.swift */,
237 | 87C8B36119FBB757006F6D54 /* enemy.png */,
238 | );
239 | name = enemy;
240 | sourceTree = "";
241 | };
242 | /* End PBXGroup section */
243 |
244 | /* Begin PBXNativeTarget section */
245 | 8734315A19BB74C400050D5B /* get-out */ = {
246 | isa = PBXNativeTarget;
247 | buildConfigurationList = 8734317B19BB74C400050D5B /* Build configuration list for PBXNativeTarget "get-out" */;
248 | buildPhases = (
249 | 8734315719BB74C400050D5B /* Sources */,
250 | 8734315819BB74C400050D5B /* Frameworks */,
251 | 8734315919BB74C400050D5B /* Resources */,
252 | );
253 | buildRules = (
254 | );
255 | dependencies = (
256 | );
257 | name = "get-out";
258 | productName = "get-out";
259 | productReference = 8734315B19BB74C400050D5B /* get-out.app */;
260 | productType = "com.apple.product-type.application";
261 | };
262 | 8734317019BB74C400050D5B /* get-outTests */ = {
263 | isa = PBXNativeTarget;
264 | buildConfigurationList = 8734317E19BB74C400050D5B /* Build configuration list for PBXNativeTarget "get-outTests" */;
265 | buildPhases = (
266 | 8734316D19BB74C400050D5B /* Sources */,
267 | 8734316E19BB74C400050D5B /* Frameworks */,
268 | 8734316F19BB74C400050D5B /* Resources */,
269 | );
270 | buildRules = (
271 | );
272 | dependencies = (
273 | 8734317319BB74C400050D5B /* PBXTargetDependency */,
274 | );
275 | name = "get-outTests";
276 | productName = "get-outTests";
277 | productReference = 8734317119BB74C400050D5B /* get-outTests.xctest */;
278 | productType = "com.apple.product-type.bundle.unit-test";
279 | };
280 | /* End PBXNativeTarget section */
281 |
282 | /* Begin PBXProject section */
283 | 8734315319BB74C400050D5B /* Project object */ = {
284 | isa = PBXProject;
285 | attributes = {
286 | LastUpgradeCheck = 0600;
287 | ORGANIZATIONNAME = "Cor Pruijs";
288 | TargetAttributes = {
289 | 8734315A19BB74C400050D5B = {
290 | CreatedOnToolsVersion = 6.0;
291 | DevelopmentTeam = BSN9DSQ2C4;
292 | };
293 | 8734317019BB74C400050D5B = {
294 | CreatedOnToolsVersion = 6.0;
295 | TestTargetID = 8734315A19BB74C400050D5B;
296 | };
297 | };
298 | };
299 | buildConfigurationList = 8734315619BB74C400050D5B /* Build configuration list for PBXProject "get-out" */;
300 | compatibilityVersion = "Xcode 3.2";
301 | developmentRegion = English;
302 | hasScannedForEncodings = 0;
303 | knownRegions = (
304 | en,
305 | Base,
306 | );
307 | mainGroup = 8734315219BB74C400050D5B;
308 | productRefGroup = 8734315C19BB74C400050D5B /* Products */;
309 | projectDirPath = "";
310 | projectRoot = "";
311 | targets = (
312 | 8734315A19BB74C400050D5B /* get-out */,
313 | 8734317019BB74C400050D5B /* get-outTests */,
314 | );
315 | };
316 | /* End PBXProject section */
317 |
318 | /* Begin PBXResourcesBuildPhase section */
319 | 8734315919BB74C400050D5B /* Resources */ = {
320 | isa = PBXResourcesBuildPhase;
321 | buildActionMask = 2147483647;
322 | files = (
323 | 8739812919E73ABD00466482 /* button.png in Resources */,
324 | 878CF4B119F9849D00336E0F /* joystick_shoot.png in Resources */,
325 | 87262AA919C830760052C448 /* player.png in Resources */,
326 | 8734572C19FD94EF008EA491 /* levels in Resources */,
327 | 87DA76F819E09C0200B9D52C /* tile_wall.png in Resources */,
328 | 870A6A7219C71E16001A2ABE /* WalkImages.atlas in Resources */,
329 | 8734316C19BB74C400050D5B /* Images.xcassets in Resources */,
330 | 87D93FD519D580D5000C2825 /* tile_example.png in Resources */,
331 | 8739812719E736BC00466482 /* joystick_move.png in Resources */,
332 | 8734316319BB74C400050D5B /* GameScene.sks in Resources */,
333 | 87E4D24119D8B9CF00E4DE8C /* tile_floor_selected.png in Resources */,
334 | 87B779E31A025FE900323172 /* healthbar.png in Resources */,
335 | 870A6A7619C72193001A2ABE /* tile_floor.png in Resources */,
336 | 87C8B36219FBB757006F6D54 /* enemy.png in Resources */,
337 | 8734316A19BB74C400050D5B /* Main.storyboard in Resources */,
338 | );
339 | runOnlyForDeploymentPostprocessing = 0;
340 | };
341 | 8734316F19BB74C400050D5B /* Resources */ = {
342 | isa = PBXResourcesBuildPhase;
343 | buildActionMask = 2147483647;
344 | files = (
345 | );
346 | runOnlyForDeploymentPostprocessing = 0;
347 | };
348 | /* End PBXResourcesBuildPhase section */
349 |
350 | /* Begin PBXSourcesBuildPhase section */
351 | 8734315719BB74C400050D5B /* Sources */ = {
352 | isa = PBXSourcesBuildPhase;
353 | buildActionMask = 2147483647;
354 | files = (
355 | 8734316519BB74C400050D5B /* GameScene.swift in Sources */,
356 | 87284FD319F98FE00050ACBC /* Weapon.swift in Sources */,
357 | 87E4A90919DB403600E522A3 /* DebugLabel.swift in Sources */,
358 | 87704FCF19E42A3000AC782F /* TileFactory.swift in Sources */,
359 | 87520D8419FC67EA0041B8CF /* Collisions.swift in Sources */,
360 | 878FE39419C5AA8A00E3DA63 /* Tile.swift in Sources */,
361 | 87B6E5D819D8B31D00CDB949 /* LocationLogic.swift in Sources */,
362 | 876041C919FD3BA20027ADE5 /* SubclassNode.swift in Sources */,
363 | 87B779E11A0252CC00323172 /* Healthbar.swift in Sources */,
364 | 87D6422019C5EA3600A12784 /* Player.swift in Sources */,
365 | 8734316719BB74C400050D5B /* GameViewController.swift in Sources */,
366 | 87A441DE19E6C47600AC4970 /* Enemy.swift in Sources */,
367 | 8734316119BB74C400050D5B /* AppDelegate.swift in Sources */,
368 | 8739812B19E73BD900466482 /* Button.swift in Sources */,
369 | 87694B1619D20FF90083C2E7 /* World.swift in Sources */,
370 | 876DD9FC19E43AAF004FE675 /* DebugOverlay.swift in Sources */,
371 | 87C9A20319F419D200A1D334 /* Joystick.swift in Sources */,
372 | 87C280CF19CC90B200CED293 /* AnimationActionsFactory.swift in Sources */,
373 | 87694B1819D212C60083C2E7 /* Camera.swift in Sources */,
374 | );
375 | runOnlyForDeploymentPostprocessing = 0;
376 | };
377 | 8734316D19BB74C400050D5B /* Sources */ = {
378 | isa = PBXSourcesBuildPhase;
379 | buildActionMask = 2147483647;
380 | files = (
381 | 8734317819BB74C400050D5B /* get_outTests.swift in Sources */,
382 | );
383 | runOnlyForDeploymentPostprocessing = 0;
384 | };
385 | /* End PBXSourcesBuildPhase section */
386 |
387 | /* Begin PBXTargetDependency section */
388 | 8734317319BB74C400050D5B /* PBXTargetDependency */ = {
389 | isa = PBXTargetDependency;
390 | target = 8734315A19BB74C400050D5B /* get-out */;
391 | targetProxy = 8734317219BB74C400050D5B /* PBXContainerItemProxy */;
392 | };
393 | /* End PBXTargetDependency section */
394 |
395 | /* Begin PBXVariantGroup section */
396 | 8734316819BB74C400050D5B /* Main.storyboard */ = {
397 | isa = PBXVariantGroup;
398 | children = (
399 | 8734316919BB74C400050D5B /* Base */,
400 | );
401 | name = Main.storyboard;
402 | sourceTree = "";
403 | };
404 | /* End PBXVariantGroup section */
405 |
406 | /* Begin XCBuildConfiguration section */
407 | 8734317919BB74C400050D5B /* Debug */ = {
408 | isa = XCBuildConfiguration;
409 | buildSettings = {
410 | ALWAYS_SEARCH_USER_PATHS = NO;
411 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
412 | CLANG_CXX_LIBRARY = "libc++";
413 | CLANG_ENABLE_MODULES = YES;
414 | CLANG_ENABLE_OBJC_ARC = YES;
415 | CLANG_WARN_BOOL_CONVERSION = YES;
416 | CLANG_WARN_CONSTANT_CONVERSION = YES;
417 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
418 | CLANG_WARN_EMPTY_BODY = YES;
419 | CLANG_WARN_ENUM_CONVERSION = YES;
420 | CLANG_WARN_INT_CONVERSION = YES;
421 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
422 | CLANG_WARN_UNREACHABLE_CODE = YES;
423 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
424 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
425 | COPY_PHASE_STRIP = NO;
426 | ENABLE_STRICT_OBJC_MSGSEND = YES;
427 | GCC_C_LANGUAGE_STANDARD = gnu99;
428 | GCC_DYNAMIC_NO_PIC = NO;
429 | GCC_OPTIMIZATION_LEVEL = 0;
430 | GCC_PREPROCESSOR_DEFINITIONS = (
431 | "DEBUG=1",
432 | "$(inherited)",
433 | );
434 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
435 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
436 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
437 | GCC_WARN_UNDECLARED_SELECTOR = YES;
438 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
439 | GCC_WARN_UNUSED_FUNCTION = YES;
440 | GCC_WARN_UNUSED_VARIABLE = YES;
441 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
442 | MTL_ENABLE_DEBUG_INFO = YES;
443 | ONLY_ACTIVE_ARCH = YES;
444 | SDKROOT = iphoneos;
445 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
446 | };
447 | name = Debug;
448 | };
449 | 8734317A19BB74C400050D5B /* Release */ = {
450 | isa = XCBuildConfiguration;
451 | buildSettings = {
452 | ALWAYS_SEARCH_USER_PATHS = NO;
453 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
454 | CLANG_CXX_LIBRARY = "libc++";
455 | CLANG_ENABLE_MODULES = YES;
456 | CLANG_ENABLE_OBJC_ARC = YES;
457 | CLANG_WARN_BOOL_CONVERSION = YES;
458 | CLANG_WARN_CONSTANT_CONVERSION = YES;
459 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
460 | CLANG_WARN_EMPTY_BODY = YES;
461 | CLANG_WARN_ENUM_CONVERSION = YES;
462 | CLANG_WARN_INT_CONVERSION = YES;
463 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
464 | CLANG_WARN_UNREACHABLE_CODE = YES;
465 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
466 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
467 | COPY_PHASE_STRIP = YES;
468 | ENABLE_NS_ASSERTIONS = NO;
469 | ENABLE_STRICT_OBJC_MSGSEND = YES;
470 | GCC_C_LANGUAGE_STANDARD = gnu99;
471 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
472 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
473 | GCC_WARN_UNDECLARED_SELECTOR = YES;
474 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
475 | GCC_WARN_UNUSED_FUNCTION = YES;
476 | GCC_WARN_UNUSED_VARIABLE = YES;
477 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
478 | MTL_ENABLE_DEBUG_INFO = NO;
479 | SDKROOT = iphoneos;
480 | VALIDATE_PRODUCT = YES;
481 | };
482 | name = Release;
483 | };
484 | 8734317C19BB74C400050D5B /* Debug */ = {
485 | isa = XCBuildConfiguration;
486 | buildSettings = {
487 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
488 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
489 | CODE_SIGN_IDENTITY = "iPhone Developer";
490 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
491 | INFOPLIST_FILE = "get-out/Info.plist";
492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
493 | PRODUCT_NAME = "$(TARGET_NAME)";
494 | PROVISIONING_PROFILE = "";
495 | };
496 | name = Debug;
497 | };
498 | 8734317D19BB74C400050D5B /* Release */ = {
499 | isa = XCBuildConfiguration;
500 | buildSettings = {
501 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
502 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
503 | CODE_SIGN_IDENTITY = "iPhone Developer";
504 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
505 | INFOPLIST_FILE = "get-out/Info.plist";
506 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
507 | PRODUCT_NAME = "$(TARGET_NAME)";
508 | PROVISIONING_PROFILE = "";
509 | };
510 | name = Release;
511 | };
512 | 8734317F19BB74C400050D5B /* Debug */ = {
513 | isa = XCBuildConfiguration;
514 | buildSettings = {
515 | BUNDLE_LOADER = "$(TEST_HOST)";
516 | FRAMEWORK_SEARCH_PATHS = (
517 | "$(SDKROOT)/Developer/Library/Frameworks",
518 | "$(inherited)",
519 | );
520 | GCC_PREPROCESSOR_DEFINITIONS = (
521 | "DEBUG=1",
522 | "$(inherited)",
523 | );
524 | INFOPLIST_FILE = "get-outTests/Info.plist";
525 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
526 | PRODUCT_NAME = "$(TARGET_NAME)";
527 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/get-out.app/get-out";
528 | };
529 | name = Debug;
530 | };
531 | 8734318019BB74C400050D5B /* Release */ = {
532 | isa = XCBuildConfiguration;
533 | buildSettings = {
534 | BUNDLE_LOADER = "$(TEST_HOST)";
535 | FRAMEWORK_SEARCH_PATHS = (
536 | "$(SDKROOT)/Developer/Library/Frameworks",
537 | "$(inherited)",
538 | );
539 | INFOPLIST_FILE = "get-outTests/Info.plist";
540 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
541 | PRODUCT_NAME = "$(TARGET_NAME)";
542 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/get-out.app/get-out";
543 | };
544 | name = Release;
545 | };
546 | /* End XCBuildConfiguration section */
547 |
548 | /* Begin XCConfigurationList section */
549 | 8734315619BB74C400050D5B /* Build configuration list for PBXProject "get-out" */ = {
550 | isa = XCConfigurationList;
551 | buildConfigurations = (
552 | 8734317919BB74C400050D5B /* Debug */,
553 | 8734317A19BB74C400050D5B /* Release */,
554 | );
555 | defaultConfigurationIsVisible = 0;
556 | defaultConfigurationName = Release;
557 | };
558 | 8734317B19BB74C400050D5B /* Build configuration list for PBXNativeTarget "get-out" */ = {
559 | isa = XCConfigurationList;
560 | buildConfigurations = (
561 | 8734317C19BB74C400050D5B /* Debug */,
562 | 8734317D19BB74C400050D5B /* Release */,
563 | );
564 | defaultConfigurationIsVisible = 0;
565 | defaultConfigurationName = Release;
566 | };
567 | 8734317E19BB74C400050D5B /* Build configuration list for PBXNativeTarget "get-outTests" */ = {
568 | isa = XCConfigurationList;
569 | buildConfigurations = (
570 | 8734317F19BB74C400050D5B /* Debug */,
571 | 8734318019BB74C400050D5B /* Release */,
572 | );
573 | defaultConfigurationIsVisible = 0;
574 | defaultConfigurationName = Release;
575 | };
576 | /* End XCConfigurationList section */
577 | };
578 | rootObject = 8734315319BB74C400050D5B /* Project object */;
579 | }
580 |
--------------------------------------------------------------------------------