Initialising Variables

Non-platform specific questions.

Initialising Variables

Postby jazz_e_bob » Sun Apr 18, 2004 10:20 am

I have a list of game settings.

Where can I put this code to ensure that these settings are made even before any other actors are created?

thrust = 1;
drag = 0.9;
dragBall = 0.985;
speedLimit = 10;
quarterDuration = 5;
playerRightHomeX = 64;
playerLeftHomeX = -64;
ballHomeX = 0;
postTransp = 0.4;
postFadeSpeed = 0.05;
titleFadeSpeed = 0.04;
titleIsFading = FALSE;
allGoingHome = FALSE;
userKeysOn = FALSE;
instructionsBlue.transp = 0.5;
instructionsRed.transp = 0.5;
quarterText.textNumber = 1;
quarterText.transp = 0.5;
boost = 2;
redIsBoosting = FALSE;
blueIsBoosting = FALSE;
boostDuration = 1000;
ballAndPlayersAreHome = FALSE;
returnHomeSpeed = 50;
redLeftBlueRight = TRUE;
mouseControl = FALSE;
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby makslane » Sun Apr 18, 2004 2:09 pm

To execute this before ANY other actors are created you must use Activation Regions:

- put your actor in a empty game area
- put a Activation Region around this actor
- move your view to this area
- in create event of this actor, put this initializations
- and move the view to right game place
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ingsan » Sun Apr 18, 2004 3:58 pm

I have a question on Activation Region.
When using it, do we have to link it to the view (whenever the view follows your actor) ?
Is this the way it works ?
Makslane, in my game, should it be preferable to use Activation Regions for better loading ?
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby Just4Fun » Sun Apr 18, 2004 5:04 pm

Yes ingsan, you need to move your view to the activation area desired.

Example:

Create Actor
Create Event --> Mouse Button Down --> Create Action--> Script
view.x=-600 // where the upper left corner x coordinateof the Activation Region is located
view.y=-120 // where upper left corner y coordinate of the Activation Region is located
(When mouse is left clicked on your actor, you will be taken to the Activation Region at the coordinates where the region is located.)

If you have scripted your actor's viewx,y your actor will automatically go to your new view.

Here is what MaKslane said about Activation Regions in a previous post:
============================================

"So, your game will load more fast and save memory if your levels have many scripts, or actors....


How save memory?

Your splash will be unloaded when your Activation Region not more intersect the view !


This thing make easy have multiple level in one ged file"



http://game-editor.com/forum/viewtopic. ... highlight=

============================================


HTHs
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby jazz_e_bob » Sun Apr 18, 2004 10:15 pm

Thanks. :)
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby jazz_e_bob » Sun Apr 18, 2004 10:33 pm

makslane wrote:To execute this before ANY other actors are created you must use Activation Regions:

- put your actor in a empty game area
- put a Activation Region around this actor
- move your view to this area
- in create event of this actor, put this initializations
- and move the view to right game place


Note: Don't forget to put an Activation Region around the right game place. :wink:
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ingsan » Sun Apr 18, 2004 10:42 pm

And link it to view (following Just4Fun's precious advice :wink: )
Thanks again, Rachel ! :mrgreen:
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby makslane » Mon Apr 19, 2004 12:57 pm

my game, should it be preferable to use Activation Regions for better loading ?


May be, one Activation Region for game start and one for each level
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest