Page 1 of 1

how to make first screen

PostPosted: Sun Feb 19, 2012 5:57 pm
by ihpalash
i want to know how to make the basic screen like which screen has new game, load game, option, exit. can any one tell me please ??

Re: how to make first screen

PostPosted: Sun Feb 19, 2012 7:50 pm
by RippeR7420
You're going to have to be a bit more specific... The way I do it is like this:

1. I draw the image in flash or ms paint.
I make different animations for each
Buttons that gets pressed etc.

2. Create an actor in GE for your background
Image. And a different actors for each
Button.

3. Either create another actor(filled region)
To place over each button, or simply
Add a key down function on the button
Actor.

4. Now, tell the buttons what you want
Them to do. Example;
ChangeAnimation, "new game button", " button pressed", "NO_CHANGE";
LoadGame("levelOne.ged") etc...

Basically like that.. Sorry for the incorrect
Language, I'm typing this on my phone haha.

Hope this was useful!
And anymore questions just ask :)

Re: how to make first screen

PostPosted: Sun Feb 19, 2012 9:14 pm
by skydereign
Just so you know, your game menu can be in the same game file as your actual game. And since you are new I'd recommend remembering this. Almost everything in gE is handled by actors. That means if you want to do anything, in your case you want to create the menu interface you can use the same approach as you would in making other aspects of your game. Create some actors that represent the individual elements of your game and give them some animations so the player knows what they are. After that you give them code to do what you want, currently start game/load game/options/exit button. For loading you'll have to learn how to use variables and saving.

Re: how to make first screen

PostPosted: Mon Feb 20, 2012 6:43 am
by ihpalash
thanks guys. actually this community is much helpful. but i am having some problems. how can i link the game to the button. or how to make a programme of the exit button etc. can you tell me? oh one more thing guys, i am currently trying to make a game . in that game there will be a box, in which player can write name or word. and for that word different animations can roll different scene. can you guys tell me how to make that programme? i only need code. design or animation will be mine.
thanks in advance.

Re: how to make first screen

PostPosted: Mon Feb 20, 2012 7:00 am
by skydereign
Do you know what scripts are? Essentially actors use events that are able to run lines of code. In the code is how you specify what happens. In RippeR7420's suggestion the way to link the button to the game is by using the LoadGame function.
Code: Select all
LoadGame("game_name");

That loads the file game_name (in the same directory as the current game). There is also another function called ExitGame, which as it says exits the game. So you can have a mouse button down event on your exit button running this code.
exit_button -> Mouse Button Down Left -> Script Editor
Code: Select all
ExitGame();


Now for the other bit you have to understand how strings work. By the sound of it this will be a little too advance for you, since it sounds like you are just starting gE and programming in general. But here is a somewhat simple explanation. A string is a bunch of single characters put together. To do this in C you use an array, which is a collection of variables under a single name. To keep it simple you will probably use gE's built in text actor type and text handling. To create a text actor create a normal actor, and in the actor control panel, click the [Text] button. From there click the font button and select the .ttf file you want to use. Then at the bottom left where it says text input, set that to yes. This way you the user can click the text and type into it.

This leaves just checking what the text is. Wherever the event you want things to happen depending on the text you can use strcmp (takes two strings and returns a 0 if they are the same).
Code: Select all
if(strcmp(text_actor.text, "string to compare")==0)
{
    // text was string to compare
}
else if(strcmp(text_actor.text, "other string")==0)
{
    // text was other string
}

Re: how to make first screen

PostPosted: Mon Feb 20, 2012 11:04 am
by ihpalash
thanks skydereign, a lot of thanks......... actually i am 16 years old. so it's really hard for my to know about the programmings. again thanks... i will try my best to work hard on this issue...... :D :D :) :P :P