• Unlikely Objects
  • Ludography
    • Nonoku
    • Acquisition
    • Image Mark Up
  • About
Menu

Unlikely Objects

  • Unlikely Objects
  • Ludography
  • Pint Sized Planet
    • Nonoku
    • Acquisition
    • Image Mark Up
  • About

Nonoku - Simple Interactions

November 18, 2016

Another quick one. Added some touch interaction so that the tiles can be tapped and go from a hidden to a visible.

SKNodes can’t be tapped whilst they are hidden (or have an alpha of 0). In order to detect them, I’m checking the location of the touch even on the parent node and checking to see if it’s within the bounds of any of the tiles. If it is, I’m currently just marking them as visible.

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        guard let location = touches.first?.location(in: tileNode) else { return }
        for case let node as SKShapeNode in tileNode.children {
            if node.contains(location) && node.isHidden {
                node.isHidden = false
                break
            }
        }
    }
← Nonoku - ButtonsNonoku - Adding Some Color →

Latest

Unlikely Objects
Fractal Plant in Godot
about a year ago
Binary Tree in Godot
about a year ago
Sierpinski Triangle in Godot
about a year ago
Re-visiting some old code
about a year ago
React - Starting a New Project
about 3 years ago
Satsuma Tosser
about 4 years ago
1HGJ #002: Deeper and Deeper
about 7 years ago
1HGJ #001: Telekinetic Bomberman Rush
about 7 years ago
Migrating to NSPersistentContainer
about 7 years ago
Nonoku - SpriteKit Shader
about 7 years ago

Powered by Squarespace