View Swift3Save.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SpriteKit | |
class GameData : NSObject, NSCoding { | |
/// Current game slot being played "One" to "Four" | |
var currentSaveFile : String? = nil | |
/// A string to save | |
var variableA : String = "AString" | |
View SKTransform.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let transfomLayer = SKTransformNode() | |
let settings = SKSpriteNode(imageNamed:"icon_Settings") | |
transfomLayer.addChild(settings) | |
transfomLayer.setEulerAngles(vector_float3(x:120, y:0, z:0)) | |
transfomLayer.zPosition = 10000 | |
transfomLayer.position = CGPoint(x:500, y:500) | |
self.addChild(transfomLayer) | |
let rotate = SKAction.rotate(byAngle: 6.28, duration: 5) | |
settings.run(SKAction.repeatForever(rotate)) |
View sunburst.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let radius: CGFloat = 150 / 2.0 | |
let bezierPath = CGMutablePath() | |
let centerPoint = CGPoint(x: 0, y: 0) | |
var thisPoint = CGPoint(x: radius, y: 0) | |
bezierPath.move(to: centerPoint) | |
var thisAngle: CGFloat = 90 | |
let unitCount: CGFloat = count | |
let spacingDegrees: CGFloat = 6.0 | |
let sliceDegrees: CGFloat = 360.0 / unitCount - spacingDegrees |
View comment_import.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xmltodict | |
import time | |
import hashlib | |
import os | |
import cgi | |
""" | |
Desired structure based on my post URLS: /data/comments/2016-07-12-post-slug/comment-uniquehash.yml | |
Data in comment is structured like this: |
View cutscene.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.entity.ui?.cutscene?.addSequences(sequences: [ | |
self.bringSpeakersIntoView(), | |
self.stouWarnsUnderAttack(), | |
self.delayForTime(time: 4), | |
self.barricOffersHisTroops(), | |
self.panCameraForFight(), | |
self.takeSpeakersOutOfView() | |
]) |
View uilabeloutline.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if let font = UIFont(name: "DamascusSemiBold", size: 24) { | |
let textFontAttributes = [ | |
NSFontAttributeName : font, | |
// Note: SKColor.whiteColor().CGColor breaks this | |
NSForegroundColorAttributeName: UIColor.whiteColor(), | |
NSStrokeColorAttributeName: UIColor.blackColor(), | |
// Note: Use negative value here if you want foreground color to show | |
NSStrokeWidthAttributeName: -3 | |
] |
View Launch.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Uses physics equations to calculate position of projectile at given time. | |
/// This tool is awesome to explain what's happening, and play with sample data: | |
/// http://hyperphysics.phy-astr.gsu.edu/hbase/traj.html#tra6 | |
func launchAtPoint(angle:CGFloat, start:CGPoint, end:CGPoint, node:SKNode) -> SKAction { | |
/// Constants | |
let gravity : Double = 9.8 | |
let pixelsToMeters : CGFloat = 50 | |
/// Calculate everything we can given an angle and an end point |
View 0105changeling.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Leveling Up & UI | |
- Double confirmation UI pattern (delet save file for an example) | |
- Unit abilities card shows ability description, and updates unit stats in preview mode | |
- After battle combat shows more information (still bugs & polish needed) | |
- You can actually choose a new skill when a unit levels up | |
- Unit cards now show stars for the units level | |
- Navigation icons show red circle withnumber when upgrades are available | |
In Game | |
- Performance imporvement for sounds (still a major bottleneck though) |
View gamedata.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GameData : NSObject, NSCoding { | |
/// Data to save | |
var variableA : Int = 1 | |
var variableB : Int = 2 | |
var variableC : Int = 3 | |
NewerOlder