Index attribute with decimals?

GuaveMediaGuaveMedia Member, PRO Posts: 1,262
edited January 2012 in Working with GS (Mac)
Hey,

I have an attribute that has to go up (from zero) to 200 when the scene starts.
I used an index because I do not want it to be negative and also have decimals. But
why does interpolate do it in decimals? I just have this:

After 0.1sec,
interpolate speed to 200
duration 0.5

I want it to go up like this but without decimals...thanks for support

Alex

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You need to use a REAL attribute for decimal places
  • GuaveMediaGuaveMedia Member, PRO Posts: 1,262
    I want it WITHOUT decimals! That was my question *gg*

    I am using an index attribute with interpolate but still get decimals.
  • MotherHooseMotherHoose Member Posts: 2,456
    edited January 2012
    just put the function Floor (or ceil) in the Display Text expression … ex: Text: floor(game.speed)

    floor function rounds a decimal# down to a whole number … as a floor of a room is down
    ceil function rounds a decimal# up to a whole number … as the ceiling of a room is up

    all number attributes can be manipulated by the math operants/functions … 
    all but real-type round-off the number when math operation is done.

    integer type attributes store whole numbers; positive or negative
    index type attributes store whole numbers; positive
    real type attributes store whole or decimal numbers; positive or negative

    in many programs you can only use integer-type and add code for the type of storage you want.
    In GS, you define the # attribute, and chose the type of storage you want when you create it …
    this most often simplifies coding and saves confusion for the new developer.

    @AIGames … you tried something new and added to your skills!

    learning is such fun … once we forbid ourself to be overwhelmed by frustration!

    @};- MH
Sign In or Register to comment.