Is this code right?

Talk about making games.

Is this code right?

Postby The achievement » Fri Mar 17, 2006 7:46 pm

Hi guys, i was wondering if i add a health bar, and i run into somthing that makes my health go down or up, can i use these codes?


int apple=5;
int cake=2;
int poop=-4
int twinkie=50; lol


then ill do collision with actor on all of them, so do these work?
User avatar
The achievement
 
Posts: 220
Joined: Sun Feb 12, 2006 11:01 pm
Location: United States,Massachusetts
Score: 0 Give a positive score

Postby Novice » Sat Mar 18, 2006 11:53 am

Yes, but those codes will only initialize those varibales use that in create actor, and on collison ex.
Code: Select all
apple++;
//or
aplle+=1;

and ad a ; behind poop. :wink:
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby The achievement » Sat Mar 18, 2006 5:06 pm

Cool! Thank you Novice!
User avatar
The achievement
 
Posts: 220
Joined: Sun Feb 12, 2006 11:01 pm
Location: United States,Massachusetts
Score: 0 Give a positive score

Postby The achievement » Mon Mar 20, 2006 4:17 pm

Woudnt i use an if statement??
User avatar
The achievement
 
Posts: 220
Joined: Sun Feb 12, 2006 11:01 pm
Location: United States,Massachusetts
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest