Page 1 of 1
Hi!!
Posted: Fri Jun 01, 2007 3:38 pm
by juansrx
Hello, I`m new here, I like your editor idea I have some questions.
*Is there any basic data structure, like an array??, It could be very useful for tiles and those things.
*Is there any scrolling??
*Can I play a .mid file??
*I`m making an asteroids clone, but I have some trouble with my "ship": I don`t know how to make it advance facing certain angle.
Tanks a lot!!
Posted: Fri Jun 01, 2007 8:05 pm
by VilleK
Hi and welcome juansrx!
Is there any basic data structure, like an array
There is currently no built in array type in the scripting language. But if you look at the FileDemo example it demonstrates how to read an array-like structure from a text file and build a tile-map from that.
Is there any scrolling??
The camera is fixed in the current version of ZGE. The sample project TripleE appears to scroll, but instead it is all the sprites that are moving not the camera

However, I will soon add a feature that will make it possible to move the camera and then it will be easier to make scrolling games.
Can I play a .mid file??
No, but I hope to add that in a future version. Or some other kind of music support.
I`m making an asteroids clone, but I have some trouble with my "ship": I don`t know how to make it advance facing certain angle.
Define a variable called ShipAngle. Use KeyPress components to increase and decrease that variable when pressing left and right on keyboard.
In the Update list of the model use a ZExpression that sets the current speed and angle depending on the variable:
Code: Select all
//Rotate the model to face the direction it is moving
CurrentModel.Rotation.Z=ShipAngle;
//Update model velocity
CurrentModel.Velocity.X=cos((0.25+ShipAngle)*(2*3.14)) * 2;
CurrentModel.Velocity.Y=sin((0.25+ShipAngle)*(2*3.14)) * 2;
The "* 2" is the speed of your ship. You could use a variable for that also, like ShipSpeed and increase it when cursor up is pressed. All the "*(2*3.14)" stuff is because the rotation.z unit is cycles and the parameters to cos and sin should be in radians.
If you have trouble getting it to work, you can send your project to me (post here or PM) and I can take a look at it.
Posted: Tue Jun 05, 2007 6:29 pm
by turshija
VilleK wrote:Code:
//Rotate the model to face the direction it is moving
CurrentModel.Rotation.Z=ShipAngle;
//Update model velocity
CurrentModel.Velocity.X=cos((0.25+ShipAngle)*(2*3.14)) * 2;
CurrentModel.Velocity.Y=sin((0.25+ShipAngle)*(2*3.14)) * 2;
uhm ... i'll try making something like small sample game and ill upload source here so you can see how is it working

i just want to test my ZGE skills (i hope i didn't forget ZGE though lol)
cheers
Boris
Posted: Thu Jun 07, 2007 5:56 pm
by juansrx
Thanks^^!!, I`ll try it out!!
Last time I forgot to ask other things as:
*How about some standart input/output??(for things as: input your name)
Posted: Fri Jun 08, 2007 8:25 am
by turshija
juansrx wrote:
*How about some standart input/output??(for things as: input your name)
i don't think something like that is possible in ZGE, but I'm sure it will be implemented soon

Posted: Fri Jun 08, 2007 10:57 am
by VilleK
You mean like entering your name into a highscore table? I've been thinking about that. It would be cool to have games with highscore-tables which are saved to disk (or maybe even online).
Boris is right, it's not possible in current ZGE-version. But I add it to my todo-list for future versions!
Posted: Fri Jun 08, 2007 7:25 pm
by turshija
One more thing that will make ZGE really good and useful thing is network ...
It could be possible to make multi player games, that could be played over internet ... But of course, first lets add something like text input using keyboard and file saving then we can add some fancy stuff like network

Posted: Sun Jun 10, 2007 10:19 am
by VilleK
Yes internet-support in ZGE would be very interesting! It requires lots of research from my part though because I haven't really worked with network-programming before. But I hope to add some sort of network-support later on.
Posted: Sun Jun 10, 2007 10:21 am
by turshija
looking forward to it
