
nerbard
Apple Game Frameworks and Technologies: func Touchdown (p166) - else is missing
I think the code proposed is missing an else; in case the user moves outside the pad (where the node does not start with “controller_”), the player will continue to move continuously
func touchDown(atPoint pos : CGPoint) {
let nodeAtPoint = atPoint(pos)
if let touchedNode = nodeAtPoint as? SKSpriteNode {
if touchedNode.name?.starts(with: “controller_”) == true {
let direction = touchedNode.name?.replacingOccurrences(of: “controller_”, with: “”) player?.move(Direction(rawValue: direction ?? “stop”)!)
}
else {
player?.move(Direction.stop)
*** }***
}
}
Popular Prag Prog topics

Title: Web Development with Clojure, Third Edition - migrations/create not working: p159
When I execute the command:
user=> (create-...
New

When I try the command to create a pair of migration files I get an error.
user=> (create-migration "guestbook")
Execution error (Ill...
New

I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here.
...
New

A Common-Sense Guide to Data Structures and Algorithms, Second Edition by Jay Wengrow @jaywengrow
Hi,
I have the paperback version of t...
New

Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64)
If you follow the defau...
New

On page 78 the following code appears:
<%= link_to ‘Destroy’, product,
class: ‘hover:underline’,
method: :delete,
data: { confirm...
New

I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113.
Iteration A1 - Seeing the list of prod...
New

The allprojects block listed on page 245 produces the following error when syncing gradle:
“org.gradle.api.GradleScriptException: A prob...
New

When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New

Hello faithful readers! If you have tried to follow along in the book, you are asked to start up the dev environment via dx/build and ar...
New
Other popular topics

Any thoughts on Svelte?
Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New

I’ve been really enjoying obsidian.md:
It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New

Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face:
Perhaps if there’s enough peop...
New

poll
poll
Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New

Just done a fresh install of macOS Big Sur and on installing Erlang I am getting:
asdf install erlang 23.1.2
Configure failed.
checking ...
New

Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New

Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New

This is going to be a long an frequently posted thread.
While talking to a friend of mine who has taken data structure and algorithm cou...
New
New

Author Spotlight:
David Bryant Copeland
@davetron5000
We’re so happy to bring you another Author Spotlight, a series where we sit dow...
New
Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /erlang
- /ruby
- /opensuse
- /python
- /wasm
- /clojure
- /keyboards
- /go
- /security
- /centos
- /react-native
- /typescript
- /vim
- /swift
- /haskell
- /svelte
- /v
- /gleam
- /crystal
- /arch-linux
- /assemblyscript
- /c-plus-plus
- /vscode
- /deno
- /laravel
- /agda
- /julia
- /elm
- /ubuntu
- /zig
- /angular
- /preact
- /html
- /nerves
- /rocky
- /vuejs
- /lisp
- /neovim
- /dart
- /deepseek
- /c
- /caramel
- /grails
- /nova
- /c-sharp
- /websharper
- /revery
- /rubymotion
- /ihp
- /prolog
- /buffalo
- /idris
- /seed
- /flask
- /membrane
- /amber
- /yew
- /nitrogen