Global actor Speed up

Game Editor comments and discussion.

Global actor Speed up

Postby HillBilly » Tue Aug 29, 2006 12:30 am

I am wanting to speed up all actors when level is finished, with a global variable.

Something like:

after level:
A=A+1

directional_velocity = A;

I would like to use the same variable for all actors. So all actors will speed up that use the variable A
HillBilly
 
Posts: 68
Joined: Thu Jun 08, 2006 4:31 am
Location: OHIO, USA
Score: 4 Give a positive score

Postby makslane » Tue Aug 29, 2006 12:48 am

Just create the 'A' variable as global in the 'Add New Variable' panel
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby HillBilly » Tue Aug 29, 2006 1:32 am

Still messing something up here.

I go to--
Script
Global Code
click on Variables
Add
enter my variable name like "movespeed"

then the only thing that will take any number and save it is "Save Group" everything else does not store anything when I go to edit variable to see if it is still there.

--------------------------------------------------------------
Then in my actor control script I have

directional_velocity =movespeed;

and they sit there.
HillBilly
 
Posts: 68
Joined: Thu Jun 08, 2006 4:31 am
Location: OHIO, USA
Score: 4 Give a positive score

Postby HillBilly » Tue Aug 29, 2006 2:09 am

I think I have it now.

I forgot a line of code

movespeed=movespeed+1;
HillBilly
 
Posts: 68
Joined: Thu Jun 08, 2006 4:31 am
Location: OHIO, USA
Score: 4 Give a positive score

Postby banner88 » Tue Aug 29, 2006 5:29 am

I think I have it now.

I forgot a line of code

movespeed=movespeed+1;


You can just use movespeed++;

Saves you typing and looks better.
banner88
 
Posts: 18
Joined: Thu Aug 24, 2006 10:16 am
Score: 0 Give a positive score

Postby Game A Gogo » Tue Aug 29, 2006 8:24 pm

dont forget that the global code dosn't do the script every frame, it only perform special comands, just like you where creating a game in C script only!

so i recomand using the "View" actor or another actor.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby HillBilly » Tue Aug 29, 2006 10:47 pm

OK. Thanks for the info.
HillBilly
 
Posts: 68
Joined: Thu Jun 08, 2006 4:31 am
Location: OHIO, USA
Score: 4 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest