The Daily Click ::. Forums ::. Klik Coding Help ::. Does it make sense to make most objects global?
 

Post Reply  Post Oekaki 
 

Posted By Message

Bo Fu



Registered
  02/04/2004
Points
  413

VIP Member
1st January, 2008 at 01:27:06 -

I was wondering if making recurring objects in my game - such as sprites - global objects would save room. If I make an enemy sprite global, will it screw up the game when I have more than one of that sprite in a level?

 
If wishes were fishes then we'd all smell like ladies' underwear.

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
1st January, 2008 at 05:54:56 -

Don't think it would mess with object selection, so multiple enemies is no problem.

I'd certainly have the player as a global object, in case you want to change his anims any time.

 
191 / 9999 * 7 + 191 * 7

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
1st January, 2008 at 06:40:58 -

Yea sticking with global objects is a good idea. Be sure to copy/save any game files or objects that have been 'globalified' just incase it all breaks.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

Bo Fu



Registered
  02/04/2004
Points
  413

VIP Member
9th January, 2008 at 01:38:30 -

Thanks for the replies. Sorry I forgot about this thread that I made.

If I have one of Enemy A in Frame 2, and his Alterable Value A (HP, default 10/10) happens to be 5/10 because the player hit him five times, in Frame 3, will any instances of Enemy A have the carried over 5/10?

Also, does this really save a lot of space? I know it'd save a heck of a lot of time if I wanted to change graphics and whatnot.

 
If wishes were fishes then we'd all smell like ladies' underwear.
   

Post Reply



 



Advertisement

Worth A Click