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 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 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 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 Swift3SaveUsage.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
/// User clicks on slot one, so we want to create a new save file for that slot | |
if GameData.sharedInstance.loadGame(saveFile: "One") { | |
/// An existing save file was there, progress as you need to | |
} | |
else { | |
/// A new save file was created, so start your game from a fresh state | |
} | |
/// User buys 100 gold | |
GameData.sharedInstance.bank += 100 |
View Swift3SaveClass
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 Level : NSObject, NSCoding { | |
var highScore : Double = 0 | |
var completed : Bool = false | |
var revealed : Bool = false | |
required init?(coder: NSCoder) { | |
self.highScore = coder.decodeDouble(forKey: "highScore") |
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" | |
NewerOlder