Last question for my game. (Please read)

DanielAvniDanielAvni Member Posts: 114
edited November -1 in Working with GS (Mac)
Ok well i need to make it so once you beat the level you unlock the next level and a character. This is possible for it to save the progress right? I was thinking to do is make a boolean and once you get to the top of the level you change the boolean to true.
Make it so:
level icon:
Rule: attribute = true: change resolution or spawn icon.
Otherwise set resolution to 0 or not be there.
and kinda the same thing with the character..

Comments

  • synthesissynthesis Member Posts: 1,693
    the save attribute behavior will also save the value to memory...so it remembers your progress if you turn the game off and come back later.

    Check the support reference about save and load attributes.
  • DanielAvniDanielAvni Member Posts: 114
    Ok thanks that answered all my load and save question but i have one more if u don't mind answering.
    I made 2 attributes (real) y and x
    Monkey actor: constrain : y/x to position.x/y
    banana : constrain: position.x/y to x/y but theres something wrong when it moves the banana moves down instead of staying constrained PLEASE HELP
  • synthesissynthesis Member Posts: 1,693
    First of all...use integer attributes. XY pixel positions are whole numbers ... not decimals. Real attributes allow for decimals/fractions.

    So...if your next position value has the potential to be a decimal value...
    use this expression:
    floor(self.position.y/self.position.x) or whatever equation goes in the middle.

    Read up on expression in the support for more info about what is available.

    Also...handle the X and Y positions separately...do not try to handle them at the same time.
    Hope this helps you.

    Also...
    If you are looking to force the banana to only move in the +/- X direction and lock the Y direction...
    then do this...
    create an integer attribute: self.AChangingXValue
    create another integer attribute: self.AFixedYValue

    Constrain self.AChangingXValue to [ floor(whatever expression you want or need goes here) ]

    Constrain self.position.X to self.AChangingXValue
    Constrain self.position.Y to self.AFixedYValue

    TIP:
    Make your attribute names descriptive...they will help you in thinking through the logic. Don't use space when naming the attributes...just use CAPS to start each word...as shown above.
  • DanielAvniDanielAvni Member Posts: 114
    Can you explain the floor attribute for me? and i dont get
    create an integer attribute: self.AChangingXValue
    create another integer attribute: self.AFixedYValue

    Constrain self.AChangingXValue to [ floor(whatever expression you want or need goes here) ]

    Constrain self.position.X to self.AChangingXValue
    Constrain self.position.Y to self.AFixedYValue
  • synthesissynthesis Member Posts: 1,693
    floor (and ceiling) is an expression...not an attribute...which is used in algorithms. It is similar to rounding but different in the sense that it forces the integer one way...where rounding goes 2 ways depending on the value. It is used to drop all decimals in a value...which is relevant since you can't have a fractional X or Y position.

    eg.
    floor(3.14125678467855) = 3
    floor(5673.583476589) = 5673
    ceil(456.45566734) = 457
    ceil(123.67533578) = 124

    http://gamesalad.com/wiki/interface_reference:expression_editor

    in general...
    it sounds like you really need to do some reading in the forums or in the reference section/tutorials. this is basic stuff and I think a little boot camp training is necessary before going into battle :)
Sign In or Register to comment.