I just got a job about a week ago that will involve me teaching children how to program games this summer. The juniors are going to be learning MicroWorlds, which is a very basic game making software aimed at children about 7-9 years old. The seniors I’ll be teaching are about 11-12. They will be learning Java. I have a reasonable amount of game-making experience using Java, but I’ve never come across a library that allows making 2D games to be particularly easy for a newbie. Slick2D is incredibly easy from the perspective of an adult programmer, and LibGDX is alright once you get the hang of it. Still, I’d like these kids to be able to use something simpler. Something that already has defined what a game object is, preferably.
I may be underestimating these kids, since I’ve heard that many of the seniors are quite bright. I am planning on teaching them how to make basic 2D games using Java2D since I think it would be a hassle to install an external library on each of their machines. Still, I WANT to define what a game object is for them, and WANT to have those game objects easily attachable to a world. I also WANT to be able to have those game objects communicate with each other easily. I might write something like this so that they can access all game objects of a certain type.
public <T> List<T> getAll(Class<T> c)
{
List<T> list = new ArrayList<>();
for(GameObject go : gameObjects)
{
if(c.isAssignableFrom(go.getClass()))
list.add((T)c);
}
return list;
}
Using this method would be as simple as this…
List<Wall> walls = world.getAll(Wall.class);
List<Collidable> collidables = world.getAll(Collidable.class);
for(Wall w : walls)
{
for(Collidable c : collidables)
{
w.enforceCollision(c);
}
}
This should make it much easier to get their ideas implemented as quickly as possible. Since they’re young, I’m not expecting them to create anything too cpu-intensive, so such an ugly design would be perfectly suitable and simple for these novices. Nevertheless, I will expect them to write their own game object implementations. They will have to write the code for their spaceship, or they will have to write the code for their jumping player. The basic library I’m writing won’t take long to make, and mostly just handles rendering for them as well as attaching game objects to a world. It also simplifies game object communication.
If anyone has any experience in teaching game programming to children 11-12, or just programming in general, could you tell me if I am I overreacting in assuming that these children will have a hard time understanding Java2D? Am I making it too easy for them by making this library? I know another programming counselor is teaching Python to his students using PyGame, although I’ve never actually used it myself. I’m assuming that it’s much simpler to use for making basic games than making a game straight from Java2D.