Score Platform

yasoofxyasoofx Member Posts: 332
Hello Again. So i made the platform do everything but now i wanna make the platform randomizes the Y Axis like sometimes it is a little up and some times its down. How can i do that??

Best Answer

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,772
    Accepted Answer
    @yasoofx, an update to my previous demo is attached. I added a random offset for the Y axis in the spawn behavior.

    Keep in mind this is very rough, I'd expect you'd want to limit the top and bottom Y location so the platforms don't go off the screen, and consider adding space between some platforms.

    Hope this helps some.

Answers

  • -Timo--Timo- Member Posts: 2,313
    change self.position.y to random(min,max)
    so it could be something like random(50,100)
    hope this helped :)
    good luck
  • yasoofxyasoofx Member Posts: 332
    change self.position.y to random(min,max)
    so it could be something like random(50,100)
    hope this helped :)
    good luck
    it still stays the same
  • -Timo--Timo- Member Posts: 2,313
    what do you now have exactly?
  • yasoofxyasoofx Member Posts: 332
    what do you now have exactly?
    Score,Charcter Running, And a platform that is only one but destroy and comes back like endless platform
  • -Timo--Timo- Member Posts: 2,313
    what do you have inside the platform?
  • yasoofxyasoofx Member Posts: 332
    what do you have inside the platform?
    Spawn( if the actor pass (X) spawn) and Destroy(if the actor pass through (x) Destroy) Behavor and acceleration
  • -Timo--Timo- Member Posts: 2,313
    and also put a change attribute to it with change self.position.y to random(10,50) <- or something
  • yasoofxyasoofx Member Posts: 332
    @yasoofx, an update to my previous demo is attached. I added a random offset for the Y axis in the spawn behavior.

    Keep in mind this is very rough, I'd expect you'd want to limit the top and bottom Y location so the platforms don't go off the screen, and consider adding space between some platforms.

    Hope this helps some.
    Jamie YOu helped me 2 times today wow. THANKS ALOOOOT!!
  • yasoofxyasoofx Member Posts: 332
    @yasoofx, an update to my previous demo is attached. I added a random offset for the Y axis in the spawn behavior.

    Keep in mind this is very rough, I'd expect you'd want to limit the top and bottom Y location so the platforms don't go off the screen, and consider adding space between some platforms.

    Hope this helps some.
    Jamie YOu helped me 2 times today wow. THANKS ALOOOOT!!
    one thing. why does it keep going up . doesnt stay one place
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    That is the random offset for the Y axis, I set it to pick a random number between -20 and 20 pixels so it will move up and down depending on the numbers picked.

    Like I said, that is very rough just to give you the concept. You'll want to play with the code to make it function 'just so' for your game.
  • yasoofxyasoofx Member Posts: 332
    That is the random offset for the Y axis, I set it to pick a random number between -20 and 20 pixels so it will move up and down depending on the numbers picked.

    Like I said, that is very rough just to give you the concept. You'll want to play with the code to make it function 'just so' for your game.
    so your going to make the code right now. if yes, cool it will be much easier for me to know more about gamesalad
Sign In or Register to comment.