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
<script> | |
$(document).ready(function() { | |
$('#paypal_submit').click(); | |
}); | |
</script> |
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
void Update() { | |
Vector2 newVel = new Vector3(walkSpeed * input.horizontal, rigidbody2D.velocity.y); | |
rigidbody2D.velocity = newVel; | |
/* Use jumpPressed to start a jump so they have to press it *while* being canJump is true */ | |
if(input.jumpPressed && canJump) { | |
rigidbody2D.velocity = new Vector2(0,jumpForce); | |
if(jumpClips!=null & jumpClips.Length>0) { | |
AudioClip jumpClip = jumpClips[ Mathf.FloorToInt( Random.Range(0,jumpClips.Length-1) ) ]; |
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
float xVel = rigidbody2D.velocity.x; | |
xVel += Time.deltaTime*playerState.playerSettings.walkSpeed*input.directionalPad.x*playerState.playerSettings.walkAcceleration; | |
float sign = xVel/Mathf.Abs(xVel); | |
if(Mathf.Abs(xVel)>playerState.playerSettings.maxWalkSpeed) xVel = sign*playerState.playerSettings.maxWalkSpeed; | |
// TODO: Use a non-animation based method here | |
if(player.playerAnimation.currentAnimation=="CrowSprint") xVel *= 1.4f; // Speed up in sprint animation | |
rigidbody2D.velocity = new Vector2(xVel, rigidbody2D.velocity.y); |
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
float xVel = rigidbody2D.velocity.x; | |
xVel += Time.deltaTime*playerState.playerSettings.walkSpeed*input.directionalPad.x*playerState.playerSettings.walkAcceleration; | |
float sign = xVel/Mathf.Abs(xVel); | |
if(Mathf.Abs(xVel)>playerState.playerSettings.maxWalkSpeed) xVel = sign*playerState.playerSettings.maxWalkSpeed; | |
// TODO: Use a non-animation based method here | |
if(player.playerAnimation.currentAnimation=="CrowSprint") xVel *= 1.4f; // Speed up in sprint animation | |
rigidbody2D.velocity = new Vector2(xVel, rigidbody2D.velocity.y); |
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 func albumsWithJSON(allResults: NSArray) -> [Album] { | |
// Create an empty array of Albums to append to from this list | |
var albums = [Album]() | |
// Store the results in our table data array | |
if allResults.count>0 { | |
// Sometimes iTunes returns a collection, not a track, so we check both for the 'name' |
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
#!/usr/bin/env xcrun swift -i -sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk | |
import Cocoa | |
/* Some Swiftyness Here */ |
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
In your APIController: | |
Modify the protocol to understand arrays: | |
protocol APIControllerProtocol { | |
func didRecieveAPIResults(results: NSDictionary) | |
func didRecieveAPIResults(results: NSArray) | |
} | |
Add a get function to perform arbitrary gets on URLs |
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
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
// Find this cell's album by passing in the indexPath.row to the subscript method for an array of type Album[] | |
let album = self.albums[indexPath.row] | |
cell.text = album.title | |
cell.image = UIImage(named: "Blank52") | |
cell.detailTextLabel.text = album.price | |
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
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
if cell == nil { | |
cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier) | |
} | |
var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary | |
// Add a check to make sure this exists |
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
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { | |
var cell: UITableViewCell = tableView.dequeueReusableCellWithIdentifier(kCellIdentifier) as UITableViewCell | |
if cell == nil { | |
cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: kCellIdentifier) | |
} | |
var rowData: NSDictionary = self.tableData[indexPath.row] as NSDictionary | |
// Add a check to make sure this exists |