CS/INFO 4152: Advanced Topics in Computer Game Development

Demos

Because we are all using the same same engine this year, it is possible for us to post some code samples for 4152. 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.

Ship Demo

This is a basic demo of CUGL that shows off the proper way to use a Scene Graph. It also shows how to write an application that takes multiple forms of input. This demo is the one shown in the first day of class.

Poly Demo

This demo shows how to use the classes for drawing textured 2D polygons. 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 shapes without the need to program.

This demo also shows off how to process multi-touch input via panning. However, panning is somewhat sensitive on Android devices. If the two fingers are too close together, it will not register as a pan.

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. The layout managers can get quite confusing, however. We will have an entire lecture on scene graphs addressing this topic.

Rocket Demo

This demo shows the proper way to use Box2D in CUGL, decoupled from the scene graph. This is a port of (part 1 of) Lab 4 from 3152. The demo uses wireframes to show the physics fixtures. You can toggle these wireframes by double clicking, or using D on the keyboard. Unlike the first demo demos, the scene graph is created in software and not by the assets JSON file. This is to give you a better idea of how physics objects and the scene graph relate.

Ragdoll Demo

This demo shows the proper way to use Box2D to create complex, jointed objects. This is a port of (part 3 of) Lab 4 from 3152. This demo uses wireframes to show the physics fixtures. You can toggle these wireframes by double clicking, or using D on the keyboard.

Platformer Demo

The last of the Box2d demos, this is a port of (part 2 of) Lab 4 from 3152. It does not show any Box2 features that you did not already see in the previous demos. Instead, the primary focus of this demo is character control, showing how you might control a platformer on a touch device. Press the sides to go in a direction. Swipe up on the opposite movement side to jump. Finally, press the bottom of the screen to fire.
JSON Demo

This demo is mostly identical to the Rocket Demo. However, instead of hard-coding the level layout, the level is defined by a JSON file. This demo shows you how to add custom loaders to the Asset Manager and use that to load your levels.

Memory Demo

This demo shows how to use preallocation and free lists to control object allocation. It is a fairly bare bones demo; just click to create a particle.