PDA

View Full Version : Cartesian Chaos - Game.Dev Comp 15 Final Entry



Evil_Toaster
01-08-2007, 07:28 PM
Hi All,

I'd like to show you guys the final entry I made for the local Game.Dev competition. The prototype version was previously featured here under the old name 'Monster Maths'.

The mandate for the competition was to build an educational game which breaks away from the traditionally boring way in which such games are presented. In other words, to build a game that's fun, but happens to be educational at the same time.

Cartesian Chaos (formerly Monster Maths) is a game based on teaching players about the cartesian plane, starting with quadrants, then X,Y points, and finally line formulas.

I didn't manage to complete the game in its entirety for the comp, what what is finished is working pretty well, and I'm looking into releasing a commercial version in the months to come.

See the links below:

Cartesian Chaos - Game.Dev Forum Entry Thread (http://forums.tidemedia.co.za/oldforums/viewtopic.php?f=15&t=2494)
Direct Link - Cartesian Chaos v0.7b (http://www.retrotoast.com/downloads/CartesianChaos-v0.7b.zip)


http://www.retrotoast.com/downloads/CartesianChaos-SS-Quadrants.jpg

I hope you all enjoy the game.

Evil_Toaster,
Retrotoast Studios

arthurprs
01-08-2007, 08:36 PM
I already have the previous version , also the name was different "Monsters Math", vry funny game ^^ i liked a lot

Hey you can tell me how make these light links ?


*sorry my english

Evil_Toaster
01-08-2007, 09:43 PM
[quote="arthurprs"]I already have the previous version , also the name was different "Monsters Math", vry funny game ^^ i liked a lot

Hey you can tell me how make these light ]

Thanks. ;)

The lightning? It's a little complicated. The lightning is made of eight 512x64 images which I cycle through.

I use the asphyre graphics library, which allows you to draw a quad with 4 arbitrary vertices. (The library you use will need to support that) To draw the lightning, I start with having a beginning and an end point, but I actually need 4 points. So, I map two points per side out at an angle of 90 degrees from the line formed by the start and end points. This is done with vector maths. To find this, you go something like:


LineVector := PointReal(End.X-Start.X,End.Y-Start.Y);
PerpVector := NormaliseXY(-LineVector.Y,LineVector.X); // Find normalised vector perpendicular to line.
{ To normalise, Divide the vector's X and Y by its magnitude (length), calculated by going Magnitude = Sqrt(Sqr(Vector.X)+Sqr(Vector.Y)) }
Points[0].X := Start.X + MultiplyVector(PerpVector,32);
Points[0].Y := Start.Y + MultiplyVector(PerpVector,32);
Points[1].X := Start.X + MultiplyVector(PerpVector,-32);
Points[1].Y := Start.Y + MultiplyVector(PerpVector,-32);
Points[2].X := End.X + MultiplyVector(PerpVector,32);
Points[2].Y := End.Y + MultiplyVector(PerpVector,32);
Points[3].X := End.X + MultiplyVector(PerpVector,-32);
Points[3].Y := End.Y + MultiplyVector(PerpVector,-32);

// Draw the image using Points


This basically gives you a rotated rectangle, which is centered on, and between the line formed by the Start and End points

In Asphyre, you also need to ensure that those points are drawn in a clockwise order. Not too sure how I did that, I just tried different things until it worked. ;)

arthurprs
01-08-2007, 09:57 PM
Thx for the reply, i think i have understand but what is draw with 4 vectices ?

Evil_Toaster
01-08-2007, 10:11 PM
Thx for the reply, i think i have understand but what is draw with 4 vectices ?

To put it simply, a vertice is a point. In 2D, it's (x,y), in 3D it's (x,y,z). A number of vertices make up a shape:
2 vertices: Line
3 vertices: Triangle
4 vertices: Quad
etc

So what I mean by drawing with 4 vertices is instead of a draw function which accepts an X, Y, Width, Height, you need one that will accept 4 vertices (points) to draw.

arthurprs
01-08-2007, 10:12 PM
Thx for the reply, i think i have understand but what is draw with 4 vectices ?

To put it simply, a vertice is a point. In 2D, it's (x,y), in 3D it's (x,y,z). A number of vertices make up a shape:
2 vertices: Line
3 vertices: Triangle
4 vertices: Quad
etc

So what I mean by drawing with 4 vertices is instead of a draw function which accepts an X, Y, Width, Height, you need one that will accept 4 vertices (points) to draw.

2d with 4 points :?

looks vry strange to me :?

Evil_Toaster
01-08-2007, 10:22 PM
Thx for the reply, i think i have understand but what is draw with 4 vectices ?

To put it simply, a vertice is a point. In 2D, it's (x,y), in 3D it's (x,y,z). A number of vertices make up a shape:
2 vertices: Line
3 vertices: Triangle
4 vertices: Quad
etc

So what I mean by drawing with 4 vertices is instead of a draw function which accepts an X, Y, Width, Height, you need one that will accept 4 vertices (points) to draw.

2d with 4 points :?

looks vry strange to me :?

Well how about looking at it this way. A draw function defined as:
Draw(X, Y, Width, Height : Real);

If you call it using:
Draw(0,0, 64, 32);

It will draw a rectangle with the following 4 points:
Point1: (0,0)
Point2: (64,0)
Point3: (0,32)
Point4: (64,32)

You could write a different function which accepts 4 points instead:
Draw(Point1, Point2, Point3, Point4 : TPointReal);

And call it using:
Draw(PointReal(0,0),PointReal(64,0),PointReal(0,32 ),PointReal(64,32));

Both functions do exactly the same thing in this case, but the second function (if implemented correctly) would allow you to draw something using -any- 4 points, whereas the first will limit you to squares and rectangles aligned with the X and Y axis.

arthurprs
01-08-2007, 10:34 PM
Thx for the reply, i think i have understand but what is draw with 4 vectices ?

To put it simply, a vertice is a point. In 2D, it's (x,y), in 3D it's (x,y,z). A number of vertices make up a shape:
2 vertices: Line
3 vertices: Triangle
4 vertices: Quad
etc

So what I mean by drawing with 4 vertices is instead of a draw function which accepts an X, Y, Width, Height, you need one that will accept 4 vertices (points) to draw.

2d with 4 points :?

looks vry strange to me :?

Well how about looking at it this way. A draw function defined as:
Draw(X, Y, Width, Height : Real);

If you call it using:
Draw(0,0, 64, 32);

It will draw a rectangle with the following 4 points:
Point1: (0,0)
Point2: (64,0)
Point3: (0,32)
Point4: (64,32)

You could write a different function which accepts 4 points instead:
Draw(Point1, Point2, Point3, Point4 : TPointReal);

And call it using:
Draw(PointReal(0,0),PointReal(64,0),PointReal(0,32 ),PointReal(64,32));

Both functions do exactly the same thing in this case, but the second function (if implemented correctly) would allow you to draw something using -any- 4 points, whereas the first will limit you to squares and rectangles aligned with the X and Y axis.
WoW thx for the explanation, look looks fine to my mind

and sorry for disturbing

Evil_Toaster
01-08-2007, 11:02 PM
WoW thx for the explanation, look looks fine to my mind

and sorry for disturbing

No problem, I hope it helps you. I know I spent long enough figuring out how to do such things. ;)

savage
30-08-2007, 05:57 PM
Congratulations to Evil Toaster for winning the game programming competition over at http://forums.tidemedia.co.za/nag/showthread.php?t=579
and
http://mailowl.co.za/wordpress/?p=159

wodzu
06-09-2007, 07:41 AM
Congratulations ET :)

Huehnerschaender
06-09-2007, 07:43 AM
Congratulations :)