3 registered members (NnamueN, Akow, 1 invisible),
1,421
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
function to:
#273916
06/24/09 22:49
06/24/09 22:49
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
hi, in my game im creating, i have made a menu with the options "story mode", "endurance", and "credits". In the code below what would go in the ???? area to make the Story mode start? Thanks!
button(0, 0, goclick, gonorm, goover, ????, NULL, NULL)
Last edited by gamingfan101; 06/24/09 22:49.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: function to:
[Re: gamingfan101]
#273926
06/24/09 23:53
06/24/09 23:53
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
function game_starter();
PANEL* dummy =
{
button(0, 0, goclick, gonorm, goover, game_starter, NULL, NULL)
}
[...]
function game_starter()
{
enter here the starter function
}
|
|
|
Re: function to:
[Re: Espér]
#273927
06/25/09 00:02
06/25/09 00:02
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
ok, im new so not all of that really makes sense, what is the game_starter? because, there will be 2 different game types. There will be story mode and endurence mode. If i want it to play endurance what code would i use? and what do you mean when you put
function game_starter() { enter here the starter function }
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: function to:
[Re: gamingfan101]
#273929
06/25/09 00:40
06/25/09 00:40
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
do you know how functions work? If not then I don't think it's wise jumping straight into making a game. Have you completed the lite-c workshops?
If you do understand functions then you create a different function for the different sections of the game. In your case you can have 2 functions; 1 for story mode and 1 for endurance mode. We have 2 functions as they do different things.
function EnterStoryMode() { // load story mode stuff }
function EnterEnduranceMode() { // load endurance mode stuff }
Then going back to your PANEL*, for each button you replace the "FunctionOn" argument with the name of the function you want to run...
button(0, 0, goclick, gonorm, goover, EnterStoryMode, NULL, NULL)
|
|
|
Re: function to:
[Re: DJBMASTER]
#273931
06/25/09 00:51
06/25/09 00:51
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
oh i get now, just one question, would it be easier to save my story mode and endurence mode as two different programs, and say include "endurencemode.c", and include "storymode.c" ?
Last edited by gamingfan101; 06/25/09 00:52.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: function to:
[Re: DJBMASTER]
#273945
06/25/09 03:40
06/25/09 03:40
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
umm, endurance is just to see how long you can go, story mode however, has different levels and cutscenes.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: function to:
[Re: Widi]
#274126
06/25/09 19:22
06/25/09 19:22
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
ok, so would i use the if-else branching code? And also, i have used the worksops, but im using lite-c free version, so after i get to the WED workshops, all the worksops use WED, and i dont have it.
Last edited by gamingfan101; 06/25/09 19:24.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
|