Skip to content

Instantly share code, notes, and snippets.

View retrokid's full-sized avatar
🎲

Efe Ertugrul retrokid

🎲
View GitHub Profile
@retrokid
retrokid / türkçe-imla-klavuzu.md
Last active June 14, 2022 12:34
Türkçe İmla Klavuzu

A

abacı
abacılık,- ğı
abadî
aba güreşi
abajur
abajurcu
abaküs
@retrokid
retrokid / swift-init-hell.md
Last active September 30, 2022 06:58
subclassing sktexture and skspritenode

swift init hell!:

  • init() can only call super.init()
  • convenience init() can only call self.init()

when init() work for you (great!):

Your super-class:

Xcode Unit Test

NSLog(@"%s doing work...", __PRETTY_FUNCTION__);

XCTAssertEqual(matchCount, expectedCount,@"Should have matched");

XCTAssertNotEqual(matchCount, differentCount,@"Should not be matched");

XCTAssertEqualObjects(drawnCard1, drawnCard2, @"The objects must be same");
@retrokid
retrokid / fmod.m
Last active November 27, 2020 08:27
FMOD
//FMOD gist
// mod file test function
-(void)createSoundAndPlay
{
FMOD_SYSTEM *soundSystem;
FMOD_SOUND *soundFile;
NSString *modFilePath = [[NSBundle mainBundle] pathForResource:@"accord" ofType:@"mod"];
@retrokid
retrokid / var-let-array-dict.swift
Last active February 9, 2021 10:47
Swift var-let-array-dict
// Created by efe ertugrul on 18/08/16.
import Cocoa
// VAR - LET - ARRAY - DICTIONARY
// constants
let anInt : Int = 1
let aDouble : Double = 1.0
@retrokid
retrokid / GameData.swift
Created December 2, 2017 09:25
SAVE OBJECT TO DISC
// Created by efe ertugrul on 21/07/2017.
// Copyright © 2017 efe ertugrul. All rights reserved.
//
import Foundation
import SpriteKit
let DATA_KEY = "key"
class GameData : JSONObject, NSCoding
@retrokid
retrokid / GameScene.swift
Last active November 3, 2017 19:04
Delegate Protocol Swift
import Foundation
import SpriteKit
class GameScene : SKScene, PlayerControllerDelegate
{
// MARK:- PROPERTIES
var playerController : PlayerController = PlayerController()
import GameplayKit
// seed must be between: 0 - 184467440737095551615
var sourceTwister = GKMersenneTwisterRandomSource(seed: 7261500727393574700)
// it's static seed meaning the same numbers will be produced
sourceTwister.seed
// random numbers will be produced
var distrRandom = GKRandomDistribution(randomSource: sourceTwister, lowestValue: 1, highestValue: 3)
// Check user data in the tile under the player’s sprite
// Convert the player’s position into the tile map’s frame of reference
let position = tileMap.convert(playerSprite.position, from: playerSprite)
// Get the column and row of the tile that contains the position
let column = tileMap.tileColumnIndex(fromPosition: position)
let row = tilemap.tileRowIndex(fromPosition: position)
@retrokid
retrokid / 2d-character-movement-spritekit3.swift
Last active November 27, 2020 08:12
2d character movement in spritekit 3
//
// GameScene.swift
// cros
//
// Created by efe ertugrul on 19/06/2017.
// Copyright © 2017 efe ertugrul. All rights reserved.
//
import SpriteKit
import GameplayKit