S
t
a
r
t
Diary
Diary
Download egg-O-shOOter
Download
How to create your own egg-O-shOOter ?
Insight
Frequently asked questions
Questions?
egg-O-shOOter Food
Food
Links
Links
I
m
p
r
i
n
t
Klick hier für die deutschsprachige Version.

At this column you can learn to create your own egg-O-shOOter.
<<<     What is in front, what's behind?     >>>

For sure you realized one property of the egg-O-shOOter universe: 'It's flat!'.
This is striking especially while objects are rotating around the X- or Y- axis. You just can define 2-dimensional graphics and move them in a 2-dimensional world. If you look at the edge of those graphics, you just can see a thin line. What is a disadvantage concerning the optics, is a great advantage while handling the objects! A bunny can be painted and implemented into the programm very fast. Defining a 3-dimensional bunny would be a much bigger amount of work. More work for you is also more computing work for your graphic card. At least you would have to handle much more variables to define and move those objects.
Let's be satisfied with the flat world of egg-O-shOOter and be happy about the comic-like style. Physically there is no 'front-' and 'backside' at a 2-dimensional world, but there is something different at this game. For sure all objects have the same distance from the observer (you), but the graphics overlap sometimes. This overlapping is interpreted as 'front-' and 'backside' by your brain. OpenGL - the programming language of egg-O-shOOter paints all graphics at the sequence of input. Therewith later painted objects overlap sooner painted objects.
The sequence of painting objects is arranged in the following way:

1.) Background picture and frames with FramePosxxx=1
2.) Eggheart
3.) Objects with ObjectFront=0
4.) Bunnies, jumpingbunnies, eggs, icicles, flowers, bubbles, pollen in a random sequence
5.) Objects with ObjectFront=1
6.) All frames with FramePosxxx=0
7.) Objects with ObjectFront=2
8.) Displays showing points, time and so on.

The objects defined by you are painted following the sequence of the file 'themes.txt. Sooner listed objects are 'behind' later mentioned objects. Let's demonstrate this behavior by playing around with a cup, a glass and a batch of dishes. Create the following objects:

#1#
ObjectNumber=1       #1#Tasse 'Mach mal Pause' / Cup 'Have a break'
ObjectFront=0
ObjectStartActive=1
ObjectTexture=10
ObjectF=-1
ObjectD=H1
ObjectXMin=0
ObjectXMax=0
ObjectYMin=-130
ObjectYMax=-130
ObjectDMin=40
ObjectDMax=40
ObjectType=3


#1#
ObjectNumber=2       #1#Tellerstapel / Batch of dishes
ObjectFront=0
ObjectStartActive=1
ObjectTexture=5
ObjectF=-1
ObjectD=H2
ObjectXMin=+30
ObjectXMax=+30
ObjectYMin=-113
ObjectYMax=-113
ObjectDMin=60
ObjectDMax=60
ObjectType=3


#1#
ObjectNumber=3       #1#Glas / Glas
ObjectFront=0
ObjectStartActive=1
ObjectTexture=8
ObjectF=-1
ObjectD=H3
ObjectXMin=+40
ObjectXMax=+40
ObjectYMin=-103
ObjectYMax=-103
ObjectDMin=70
ObjectDMax=70
ObjectType=3

Like expected the cup is at the rear, the batch of dishes in the middle and the glass in front. Furthermore you can see that all bunnies, eggs, pollen and so on are in front of the three objects, which is caused by ObjectFront=0.
Set ObjectFront=1 for all three objects and now the bunnies, eggs and pollen are always behind the objects.
Interchange the places of the objects e.g. by listing the batch of dishes first and the cup last at themes.txt (all variables remain as they are, especially the object numbers):

#1#
ObjectNumber=2       #1#Tellerstapel / Batch of dishes
ObjectFront=1
ObjectStartActive=1
ObjectTexture=5
ObjectF=-1
ObjectD=H2
ObjectXMin=+30
ObjectXMax=+30
ObjectYMin=-113
ObjectYMax=-113
ObjectDMin=60
ObjectDMax=60
ObjectType=3


#1#
ObjectNumber=3       #1#Glas / Glas
ObjectFront=1
ObjectStartActive=1
ObjectTexture=8
ObjectF=-1
ObjectD=H3
ObjectXMin=+40
ObjectXMax=+40
ObjectYMin=-103
ObjectYMax=-103
ObjectDMin=70
ObjectDMax=70
ObjectType=3


#1#
ObjectNumber=1       #1#Tasse 'Mach mal Pause' / Cup 'Have a break'
ObjectFront=1
ObjectStartActive=1
ObjectTexture=10
ObjectF=-1
ObjectD=H1
ObjectXMin=0
ObjectXMax=0
ObjectYMin=-130
ObjectYMax=-130
ObjectDMin=40
ObjectDMax=40
ObjectType=3

You can see that the first listed objects are the ones at the rear of the egg-O-shOOter universe.
That is effective for all objects with the same value for 'ObjectFront'. Set ObjectFront=2 at the glass. You can see that the glass is at the front now, even though it is listed in the middle at the file 'themes.txt'. Here you can see the effect of defining different layers. The objects with ObjectFront=0 are painted first, followed by those with ObjectFront=1 and last those with ObjectFront=2. For hit detection the reverse sequence is used. The object painted at last (being at the foreground) is hit first - try it.
Screenshot egg-O-shOOter

<<<Back to 'The art of leaving out'          Continue with language versions>>>