Building Snake in TouchDesigner – Step One
I finally got my Oculus Rift! As a first test, I want to build a 3D Spherical Snake game. As I’ve been learning TouchDesigner and positing its usefulness as a prototyping tool, I aim to build out the game first in TD, testing the mechanics, graphics and gameplay before I set about coding it in C++.
First thing I’ve set out to do is build a normal 2D Snake game in Touch Designer before I start getting all tricky with the 3D sphere stuff. I took a few hours yesterday, and I’ve now got a controllable 3D snake moving on two axes, with variable speed and proper growth, controllable via a single number in a DAT.
You can download the current version here: MMMFlatSnake_v1.toe
It’s a reasonably simple setup, but shows some tricks that I’ve learned that may be helpful for beginners. For example:
- Using a Fan CHOP to figure out which keyboard button was pressed from a series of options (like up, down, left, right)
- Using a Sweep CHOP to draw a 3D object
- Using mod to call methods contained in DATs
- Using a startup script (‘execute1′ in this setup)
I may tackle the 3D movement next, though there are still many game items left to be implemented: Food Placement, Food Consumption, Self-Collision, Wall-Collision and Death.