Creating Variables

Non-platform specific questions.

Creating Variables

Postby smillz » Fri Nov 28, 2008 6:33 pm

Is there a way to create a varialble with the same properties as the more complex ones? (I need another variable to act as directional velocity and angle does)
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score

Re: Creating Variables

Postby DarkParadox » Fri Nov 28, 2008 6:51 pm

use a float. float works like int, but, goes into decimals allowing whatever, and you could use int, but use a float anyways
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: Creating Variables

Postby smillz » Fri Nov 28, 2008 7:20 pm

what's a float?
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score

Re: Creating Variables

Postby DarkParadox » Fri Nov 28, 2008 7:24 pm

a "real variable"
basicly, an int that supports decimals



if you need anymore help, contact me in MSN
diormeh@live.com
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: Creating Variables

Postby Fuzzy » Sat Nov 29, 2008 1:53 am

float means floating point, ie: the decimal point can move to represent many ranges of numbers. An int, or integer can only be a whole number, plus positive or negative.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: Creating Variables

Postby smillz » Sat Nov 29, 2008 9:54 pm

ok, so I know what a float is now (I knew what it was before, but I just referred to it as a real var), But does anybody know how to make a variable that acts like directional velocity? What I mean by that is I need a variable, I'll call it directional_velocity2, that reacts to "angle2"(created variable) instead of "angle"(variable already there) by making the players velocity go in the direction of "angle2"...... if that makes sense :?
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score

Re: Creating Variables

Postby Killagram » Sat Nov 29, 2008 11:44 pm

I believe that is what 'vectoradd' is for, but its kinda difficult to use.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
-Brian W. Kernighan
User avatar
Killagram
 
Posts: 31
Joined: Sun Aug 10, 2008 8:49 pm
Score: 5 Give a positive score

Re: Creating Variables

Postby smillz » Sun Nov 30, 2008 12:55 am

Killagram wrote:I believe that is what 'vectoradd' is for, but its kinda difficult to use.


well, I guess I'll try vectoradd.... anyone knows how to use it?
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score

Re: Creating Variables

Postby smillz » Sun Nov 30, 2008 7:32 pm

Never mind, I learned how to use vectoradd and it works like a charm :D
there is an example on how to use it here http://game-editor.com/examples/vectoradd.zip
smillz
 
Posts: 21
Joined: Fri Jul 20, 2007 2:10 am
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron