Global Code

Non-platform specific questions.

Global Code

Postby jazz_e_bob » Sun Dec 28, 2003 10:58 am

How do I use this feature?
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 Dec 28, 2003 8:16 pm

Use to create functions, arrays, structs to be used in your actions.
See the checkers demo, this have a lot of global code.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jazz_e_bob » Mon Dec 29, 2003 12:28 am

Will do. Thanks mate.
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

Global Code - Visual Refreshing issue?

Postby jazz_e_bob » Tue Dec 30, 2003 1:42 am

When the following Global Code is run "animpos" does not visually change.

void ShipCollides(void)
{
meter_energy.animpos -= 1;

if ((meter_energy.animpos - 1) == -1 )
{
DestroyActor("Event Actor");
DestroyActor("meter_ship");
}
else
{
CreateActor("shield", "shield", "no parent", "no path", 0, 0, 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 » Tue Dec 30, 2003 2:30 am

Change any internal Actor variables has no effect in Global Code. So, the line "meter_energy.animpos -= 1;" don't works
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jazz_e_bob » Tue Dec 30, 2003 3:40 am

Hmmm

I can control actor events but not change actor parameters.

Is there a reason for this?

I think I would like to be able to control parameters too...

:)
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 » Tue Dec 30, 2003 4:24 am

Is there a reason for this?

Yes, is a performance degradation to allow this
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby jazz_e_bob » Tue Dec 30, 2003 5:58 am

Fair enough. :)
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


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron