Raised This Month: $ Target: $400
 0% 

Deviding a define number for two cases


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-30-2013 , 16:05   Re: Deviding a define number for two cases
Reply With Quote #1

Code:
#define BALL_AMOUNT 6 enum {     SPAWN_1 = 0, //I'm never sure if enum starts with 0 or 1.     SPAWN_2, }; public makespawn() {     for(new i=0; i < BALL_AMOUNT; i++)     {         spawnballs(i)     } } spawnballs (spawn) {     switch(spawn % 2) // I don't know what the operator is called. I would explain it as, what will get left over if you deduct "2" until no longer possible. So either it's 0 or 1.     {         case SPAWN_1:         {             Add code to spawn entities around the map.         }         case SPAWN_2:         {             Add code to spawn entities around the map.         }     } }
__________________

Last edited by Black Rose; 07-30-2013 at 17:24.
Black Rose is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-31-2013 , 12:18   Re: Deviding a define number for two cases
Reply With Quote #2

Quote:
Originally Posted by Black Rose View Post
Code:
enum { SPAWN_1 = 0, //I'm never sure if enum starts with 0 or 1. SPAWN_2, };
Starts with 0.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Reply



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