Page 1 of 1

First testing app :)

Posted: Mon Feb 19, 2007 7:20 pm
by turshija
Ok i have been playing a little bit with objects and gravity and collisioning and this is my first app with that :)

i need just one thing to make a little game from this thingy:
is there any possibility to make program read something from file? For example I want to make lvl1.dat , lvl2.dat ... And program reads the level layout and puts it in game...

Boris

Posted: Tue Feb 20, 2007 4:13 pm
by VilleK
The first ZGE application not written by me :D

Cool!

Hmm... file support is not a feature yet. It might come in a later
version.

Try to use procedural techniques. Instead of having each level in a file
use something like:

Calculate difficulity for new level:
NrOfEnemies=LevelNr * 5;
NrOfObstacles=LevelNr * 3;

Then spawn obstacles and enemies using a repeat-component.

Determine "random" start locations for model that will depend
on levelnr.

EnemyModel.OnSpawn:
CurrentModel.Position.X = noise2(LevelNr*10,0) * 5;

That way you can have levels which increase in difficulty by having
more enemies and obstacles, but have the same starting positions
every time you arrive at the same level, just as if they had been
predefined in a file.

Bad thing: You cannot control exactly where enemies will appear
in each level.

Good thing: If you write some clever expressions, then your game
will have an almost infinite nr of non-repeating levels :)

It is a bit difficult to explain. I will write tutorials on procedural techniques
later on.

Posted: Tue Feb 20, 2007 6:22 pm
by turshija
ye, i know but i don't want to make level like me and then opponents spawn and stuff... I want to make something like arcade game, you play, jump over the obstacles and stuff like that ... Finishing levels, proceeding to next level with much harder obstacles, maybe some moving objects that will kill you if you touch them...

So thats why ZGE needs importing from file :)

Posted: Wed Feb 21, 2007 11:59 am
by VilleK
You can still have varied levels using code like:

Code: Select all

if(levelNr>5) {
   //spawn new kind of enemies on higher leves
}

if( frac(levelNr/2)==0 ) {
  //even levelnr: one kind of obstacles
} else {
  //odd levelnr: other kind of obstacles
}
But I see your point, and I will put file input/output on
the feature request list.

Posted: Thu Feb 22, 2007 2:23 pm
by turshija
yeah, but I would like to create some of arcade games that load the level from txt or dat file and for example they are presented as a text in some format like:
@@@@@@@@@@@@@@@@@@@
@ @
@ @
@ ___ ____ @
@ / | | \ @
@ P / | /\/\/\| \ E @
@@@@@@@@@@@@@@@@@@@

or any other way ... (use imagination ;) ) so that program can read it and set the walls and obstacles as shown in level.dat file ...

Posted: Thu Feb 22, 2007 5:55 pm
by VilleK
I'm thinking about this, and I will make some kind of file input feature
for reading data from files similar to how you describe.

But I will first release the 1.0 version, then add more features afterwards :)