stacking falling actors

I have falling actors that are spawned from the top. I want them to stack onto each other and make it appear as if the screen is slowly climbing up the tower.( Sort of like a tower stacking game.) I have tried to destroy the actor once it collides with the ground, but it doesn't seem to work. ( the action works, its just not what I want.) Can anyone help?

Answers

  • Andrea_ComisiAndrea_Comisi ItalyMember Posts: 328

    Make the ground out of the screen so during you can't see the diseappearing actor

  • MendezMendez Member Posts: 21

    @andrea_comisi I dont quite understand what you mean, could you explain?

  • Andrea_ComisiAndrea_Comisi ItalyMember Posts: 328

    Im uploading a template

  • Andrea_ComisiAndrea_Comisi ItalyMember Posts: 328
    edited August 2014
  • MendezMendez Member Posts: 21

    @Andrea_Comisi‌ Thanks for the template but thats not exactly what Im looking for. I dont just want the to collide and fall out of the screen. the actors fall one at a time and stack on top of each other. I want it to look like the screen moves up once the tower get bigger.

  • Andrea_ComisiAndrea_Comisi ItalyMember Posts: 328

    Sorry but i don't understand for what you are looking for ;(

  • tryingToMakeADollartryingToMakeADollar Member, PRO Posts: 18
    edited August 2014

    Make an Attribute game.plus50

    rule

    when actor1 collides with actor1

    Do

    Change Attribute game.plus50 to game.plus50+50

    Interpolate currentScene.Camera.Origin.y to game.plus50

    this will make the scene go up as the tower builds
    but one will need to make your scene height a lot bigger
    and 50 might be too much or too little depends on how big your actors are, so play around with it.

    just read your post again you might need to do the same for the spawning actor just use the same game.plus50

  • MendezMendez Member Posts: 21

    @tryingToMakeADollar‌ thanks for the help, I'll try that. I have a question though, if I want the stacking to to be endless how big do I have to make the scene?

  • tryingToMakeADollartryingToMakeADollar Member, PRO Posts: 18

    glad i could help

    then make another attribute game.scene100

    you can put it in the same rule or make another

    change attribute

    game.scene100 to game.scene100+100

    interpolate

    current scene.Size.Height to game.scene100

    so every time actors collide your scene will get larger (endless or until actor dies)
    let me know if it works

  • MendezMendez Member Posts: 21

    @tryingToMakeADollar‌ I tried doing what you said but it wasn't working for me, I then used change attribute instead of interpolate and it did what I wanted for a while but then it went completely wrong( either the screen would surpass the blocks or the blocks and spawner would become jumpy and then disappear). I played around with the numbers but that didn't seem to help. Is there any other way or could you explain that method again.

  • tryingToMakeADollartryingToMakeADollar Member, PRO Posts: 18

    Did the currentScene.Camera.Origin.y work ?

    it should because I use it in some of my projects

    so then u applied the scene.Size.Height then it didn't work

    is that correct?

  • tryingToMakeADollartryingToMakeADollar Member, PRO Posts: 18

    I just tested it out Interpolate works for me.

    the scene size should not do anything to the actor because its the camera that moves not the scene.

    is your spawner off the scene or part of the game(like a canon or something) ?

    maybe instead of when actor(box) collides with actor(box)

    try when spawner releases actor(box) Change attribute plus50 then interpolate camera.

    also you know when you interpolate the camera, so when the camera moves up.
    you need to do the the same to the spawner, so the camera and spawner move together

    self.position.y

    and if there is a score on your scene you need to interpolate that too.

Sign In or Register to comment.