Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (NnamueN, Akow, 1 invisible), 1,421 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
function to: #273916
06/24/09 22:49
06/24/09 22:49
Joined: Jun 2009
Posts: 148
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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 Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Code:
function game_starter();

PANEL* dummy =
{
   button(0, 0, goclick, gonorm, goover, game_starter, NULL, NULL)
}

[...]

function game_starter()
{
   enter here the starter function
}




Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: function to: [Re: Espér] #273927
06/25/09 00:02
06/25/09 00:02
Joined: Jun 2009
Posts: 148
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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 Offline
Serious User
DJBMASTER  Offline
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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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: gamingfan101] #273940
06/25/09 01:59
06/25/09 01:59
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Depends how different the 2 modes are eg, if they both use similiar graphics / models / sounds. If they are very different from each other then yes it might be wise to use 2 seperate scripts, each with their own functions and resources.

Re: function to: [Re: DJBMASTER] #273945
06/25/09 03:40
06/25/09 03:40
Joined: Jun 2009
Posts: 148
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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: gamingfan101] #274069
06/25/09 15:11
06/25/09 15:11
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Gamingfan, i read many posts from you here, there is a answer in the Workshop. Do you do it? If not, do it now. It would help you to understanding how scripting works.I start at the same way...

Re: function to: [Re: Widi] #274126
06/25/09 19:22
06/25/09 19:22
Joined: Jun 2009
Posts: 148
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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.
Re: function to: [Re: gamingfan101] #274130
06/25/09 20:12
06/25/09 20:12
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
if-else code for what? That's a pretty vague question.

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1