Pong Series
From C4 Engine Wiki
Important Note: Currently the restitution code for the physics in C4 2.0 is still being finalized. This means the ball does not behave as intended (yet), but the code for the parts of this series that have been updated for the new physics should be correct.
Contents |
Introduction
This is a simple series aimed at teaching the user how to do various tasks in C4 using the classic game Pong as an example. The first part will be the most complex, featuring a working pong game running entirely off of a simple AI. Subsequent parts will focus on adding one or two new features each such as player input, sound, particles, and networking.
I've created a post for this series in the forums here: Forum Topic. If you have any questions or comments please direct them there.
The Pong Media
PongSeries.zip This zip file contains the .wld file used in all of the parts of this series. It also contains the font used in Part 3 and later. To use it, simply extract the folder in the archive directly to C4's /data/ directory.
The Series
Prelude
Description: Currently just a simple explanation of the components in the world file used by the series, but there are plans to expand it later.
Status: C4 2.0
Part 1
Description: The most comprehensive part to the series, this article shows how to do a variety of things in C4. This includes, but is not limited to, using controllers, loading a world from code, printing to the command console, iterating through the nodes in a world, and more. The end result of this is a complete pong game where AI controls both paddles.
Status: C4 2.0
Part 2
Description: The focus of part two of the series is to add player input so that the user can control one of the paddles and play against the AI created in part one of the series.
Status: C4 1.5.9
Part 3
Description: Here a scoreboard is added to the game to replace the need to open the console to view the score. The end result is an example of creating an Interface element and adding a quad element and some text to it.
Status: C4 1.5.9
Part 4
Description: A very simple, yet effective, particle system is attached to the ball in this part of the series.
Status: C4 1.5.9
Future Parts
- Add networking for PvP matches
- Add sound effects
- Other?
