Code Samples

Since we moved to a uniform engine, it made it possible for us to start posting code samples. These samples illustrate some of the technical challenges that you might run into as part of mobile development. All of these samples come with source code. You are allowed to use the code here as reference or directly in your own games.

Right now, you will note that the samples page is pretty sparse. That is because we are still working on writing these samples for you. If you want to help us, that would be great. If you write a prototype that you think might be of use to the rest of the class, send it to us and we will post it here.

Hello CUGL

This is a basic demo of CUGL that shows off the basics features: loading assets, displaying an image, and creating simple UI elements. This demo is the one shown on the first day of class.

Space Demo

This is demo showshow to use a Scene Graph to get interesting parallax effects. It also shows how to write an application that takes multiple forms of input. This is the demo to start with when you are trying to figure out your input schemes for your game.

UI Demo

This demo shows off how to use the limited interactive UI elments supported by the engine: buttons, sliders, text fields, and layout managers. This demo makes heavy use of the assets JSON file. Your UX designer should be studying it to understand how to design interfaces.

Poly Demo

This demo shows how to create the textured scene graph nodes. The classes can be used to draw solid polygons, or polygon paths. Furthermore, we show how to define these shapes in the assets JSON file so that your UX designer can create them. See the README.md for details.