ChaoSnake

Posted on by Idorobots

This one is an oldie both in terms of its age and the programming language it uses. ChaoSnake is a "yet another Snake game" written using nothing but GLFW and OpenGL in the Pascal programming language.

0 ChaoSnake was as an end of term project on our first CS semester that gave me the top grade. It was quite fun to write, especially because of the 'chaos part' which I'll show later. Too bad it had to be implemented in Pascal-like language, because it's pretty unmaintainable, mostly due to my lack of Pascal know-how. In fact, ChaoSnake is all kinds of bad practice, one could even teach how not to code in Pascal using this game, but yeah, Pascal, yo!

I won't share much implementation detail, though you can download the game and its source here and look for yourself. I have since graduated and this page has been deleted.

It's worthy to mention, that the Snake is a FSM.

You've already seen the main menu. It's fairly simple, and no, that's not Comic Sans... It's Comic Andy, hells yeah!

Buttons are not animated, at least not the ones in the main menu. That's because I wrote my own, crappy GUI framework for this game. It supports buttons, dialogs, counters, timers, etc, all rendered using .tga's in OpenGL.

After starting a new game you need to choose the difficulty level:

1

Let's go for an easy game:

2

I'm a minimalist, so the UI is rather sparse. Two counters on the left indicate your lives and points. Tho one on the right is the timer. Yeah, this snake is dynamic; you've got TO SURVIVE ALL THIS TIME. Seriously, the game isn't easy, even on the 'easy' difficulty. Deal with it.

3

There is an additional camera mode, following the snake arround, but due to 'discrete' nature of the game it's rather annoying.

4

The levels are randomly generated accordingly to the chosen difficulty and the level counter. They become harder with each next level. Note the timer turning red, OCD much!

5

In case you were wondering what 'chaos' difficulty is like. It's pretty chaos if you ask me. Note there are only TWO lives there.

6

That's right.

789

There are a bunch of different types of snake food. The yellow one is the regular food, it does nothing. The green stuff slows the snake down for a while, and believe me that's not a power-down. Each kind of food gives a different amount of points, the more rare the food - the more points it's worth. The white one spins in the opposite direction and adds 10 seconds to the time counter:

10

The next kind of food gives you an additional life. It's the most rare kind of food:

11

12

Moving on...

13

This kind of food gives you the ability to walk through the obstacles:

14

As you might have already noticed the game is 3D.

15

And the camera is free...

16

If you actually find the time to admire those tastefully arranged cubes, that is!

17

You either win the level, if you survive untill the timer hits 0...

18

Or...

19

The game is over.

20

Either way, after pressing enter you will see your score. Another enter and you go back to the main menu, or the next level starts. There are 15 levels with increasing difficulty, but that's not all, the name's CHAOSnake for a reason...

21

Arround level 5 the chaos starts! Levels become 3D! If you thought the game was difficult, you were right. Now it's just... WHAT?

22

To properly control your snake you will need to use keyboard and the mouse.

23

It takes time to get a hold of this game in 3D.

24

In fact, I have never passed a single 3D level, but I was really close. Twice... But if you think that's too much...

25

FOURTH DIMENSION OUT OF NOWHERE! Note the food cube being half transparent. It's situated in a different, but parallel dimension! Starting with level 10 you will have to PageDown/PageUp to find the cube in addition to the regular 3D!

26

The original idea for the fourth dimension was to dim/brighten the colors depending on the 'imaginary' axis, but that didn't turn out too well.

The game is literally unbeatable in 4D. Prove me wrong, I dare you!

2016-02-18: Adjusted some links & tags.