Page 1 of 1

Initialising Variables

PostPosted: Sun Apr 18, 2004 10:20 am
by jazz_e_bob
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;

PostPosted: Sun Apr 18, 2004 2:09 pm
by makslane
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

PostPosted: Sun Apr 18, 2004 3:58 pm
by ingsan
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 ?

PostPosted: Sun Apr 18, 2004 5:04 pm
by Just4Fun
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

PostPosted: Sun Apr 18, 2004 10:15 pm
by jazz_e_bob
Thanks. :)

PostPosted: Sun Apr 18, 2004 10:33 pm
by jazz_e_bob
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:

PostPosted: Sun Apr 18, 2004 10:42 pm
by ingsan
And link it to view (following Just4Fun's precious advice :wink: )
Thanks again, Rachel ! :mrgreen:

PostPosted: Mon Apr 19, 2004 12:57 pm
by makslane
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