Raised This Month: $ Target: $400
 0% 

Deviding a define number for two cases


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
iBrazilian
Senior Member
Join Date: May 2011
Old 07-30-2013 , 14:07   Deviding a define number for two cases
Reply With Quote #1

If BALL_AMOUNT is 6 then I'd like SPAWN_1 to spawn 3 entities and SPAWN_2, spawn the other 3 entities, so half of what is defined.

How would I accomplish this with enum cases?

PHP Code:
#define BALL_AMOUNT 6

enum
{
    
SPAWN_1,
    
SPAWN_2,
};

public 
makespawn()
{
    for(new 
i=0BALL_AMOUNTi++)
    {
        
spawnballs()
    }
}

spawnballs ()
{
    switch(
spawn)
    {
        case 
SPAWN_1:
        {
            
Add code to spawn entities around the map.
        }
        case 
SPAWN_2:
        {
            
Add code to spawn entities around the map.
        }
    }

__________________
Pokemod Season 5 [ |||||||||| Complete]
iBrazilian is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode