Hi!!

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
juansrx
Posts: 2
Joined: Sat May 19, 2007 7:02 pm

Hi!!

Post 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!!
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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.
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Post 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
juansrx
Posts: 2
Joined: Sat May 19, 2007 7:02 pm

Post 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)
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Post 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 :)
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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!
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Post 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 :)
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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.
User avatar
turshija
Posts: 127
Joined: Sat Feb 17, 2007 9:26 am
Location: Novi Sad, Serbia
Contact:

Post by turshija »

looking forward to it :)
Post Reply