Global Vars

Game Editor comments and discussion.

Global Vars

Postby ingsan » Sat Apr 24, 2004 10:55 am

Please excuse me with this silly question :oops: I've always worked with Global integer variables and never felt the Need to ask myself about Local Vars, real vars and String ... I never attended any C training and learned the few things I know by myself :cry: So I know I'm missing a lot.
If someone ... anyone could spend some time explaining to me the difference among all these. I really want to structure my codes and go right to the point instead of doing some approximate things. Please help :cry:
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby jazz_e_bob » Sat Apr 24, 2004 11:07 am

Local Vars are good for things like "mass" or "health" or "playerNickName".

Once you declare "health" as a local var every actor will have its own "health" property.

Global Vars are good for things like "gravity" or "gameIsOver" or "highestScore".

DATA TYPES
Integers (non-decimal numbers)
Real (decimal numbers)
String (word(s))

Image
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 ingsan » Sat Apr 24, 2004 11:24 am

You'r ethe MAN ! 8)
Thank you so much for your precious help. Now I can see the light :idea:
:o
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron