Skip to content

Instantly share code, notes, and snippets.

string array[3] = {"foo", "bar", "quuk"};
for(auto& i : array) {
std::cout << i << "\n";
}
let array : [String] = ["foo", "bar", "quuk"]
for i in array {
print("\(i)")
}

Important Notes and Tests

  • You must start a new game. The old save files will break.
  • This build only represents 5 days of work. Moving out of office, and traveling to Austin for other days.

The Short Changeling

  • Upgrade points rewarded after leveling up.
  • Upgrades available shows as red circle with number in it on World Map screens.
  • Stou gains experience and upgrades after each level now too.

Important Notes and Tests

  • You must start a new game. The old save files will break.
  • A few features are in mid progress, but I wanted to stick to the release schedule. So, check everything out but no need to report until next update. Expect a few things to be buggy.

The Short Changeling

  • Unit Stats are now available to see. In Battle, long press on any units shield. In the Camp scene, click Stats & Abilities.
  • A new ability, Charge, has been added to melee units when engaging, and within 400px of target.
  • A new ability, Flee, has been added to melee units when engaged.

Important Notes and Tests

  • You must start a new game. The old save files will break.
  • Cutscenes reliably appear on my iPad, but mixed results on iPhone. Need more data on this.
  • Quite a lot to change in 2 weeks, so I fear regression. Let me know if you see anything super sketch

The Short Changelog

  • Brand new scene manager. Lots fixed and memory leaks should be gone.
  • Ranged units stop attacking when their target has moved out of range.
@veeneck
veeneck / component.swift
Created June 9, 2015 17:01
componentForClass
func componentForClass<ComponentType : GKComponent>(componentClass: ComponentType.Type) -> ComponentType? {
for component in self.components {
if let temp = component as? ComponentType {
return temp
}
}
return nil
}
@veeneck
veeneck / shader6.fsh
Created May 28, 2015 17:58
Shadertoy: Glowing
// https://www.shadertoy.com/view/4lB3DG
void main() {
vec4 val = texture2D(u_texture, v_tex_coord);
vec4 grad = texture2D(u_gradient, v_tex_coord);
if (val.a < 0.1 && grad.r < 0.65 && grad.a > 0.73) {
vec2 u = gl_FragCoord.xy / u_sprite_size.xy,
c = vec2(.5) - u;
float t = u_time,
@veeneck
veeneck / shader5.fsh
Created May 28, 2015 17:57
Shadertoy: Wobble
// https://www.shadertoy.com/view/XtsGDj
void main() {
vec4 val = texture2D(u_texture, v_tex_coord);
vec4 grad = texture2D(u_gradient, v_tex_coord);
if (val.a < 0.1 && grad.r < 0.65 && grad.a > 0.8) {
float t = u_time;
vec2 uv = (gl_FragCoord.xy / u_sprite_size.xy)*2.0-1.0;
float angle = atan(uv.y,uv.x) + t;
float k = true ? sin(t)*2.0 : 1.0;
@veeneck
veeneck / shader4.fash
Last active August 29, 2015 14:22
Shadertoy: Bullseye
// https://www.shadertoy.com/view/Xtl3Dj
void main() {
vec4 val = texture2D(u_texture, v_tex_coord);
vec4 grad = texture2D(u_gradient, v_tex_coord);
if (val.a < 0.1 && grad.r < 1.0 && grad.a > 0.8) {
vec2 uv = gl_FragCoord.xy / u_sprite_size.xy*2.0-1.0;
float len = sin(16.*length(uv)-u_time*4.)*0.5+0.5 ;
vec3 col = vec3(len)*vec3(0.,0.98,.0);
gl_FragColor = vec4(col,1);
@veeneck
veeneck / shader3.fsh
Last active August 29, 2015 14:22
Gradient and masking shader
void main() {
// Load the pixel from our original texture, and the same place in the gradient circle
vec4 val = texture2D(u_texture, v_tex_coord);
vec4 grad = texture2D(u_gradient, v_tex_coord);
// [1 - ORIGINAL CHECK] If the original is transparent AND
// [2 - HEALTH CHECK] The gradient image has a black value less than the remaining health AND
// [3 - MASKING] The gradient pixel is not transparent
if (val.a < 0.1 && grad.r < u_health && grad.a > 0.8) {
@veeneck
veeneck / shader2.swift
Created May 28, 2015 17:08
Using SKUniform
let sprite = self.childNodeWithName("targetSprite") as! SKSpriteNode
let shader = SKShader(fileNamed: "shader1.fsh")
shader.uniforms = [
SKUniform(name: "u_gradient", texture: SKTexture(imageNamed: "circleshader")),
SKUniform(name: "u_health", float: 0.75)
]
sprite.shader = shader