Appearing/Disappearing Blocks

OK, so I have these Mega Man blocks in my game. The problem Im facing, and it seems as if I cannot go around it any way, is that when the block disappears and the character is on it, the collision still is "active" evan though is should be deactivated. The only way to deactivate the collision is by jumping away from the block. If you know what I mean? So as long as the player touches or has contact with the block it does not "disappear". It seems like the only way around this is to destroy the block actor and respawn it or to temporarily change its location to simulate its disappearance. Or does anyone have a better solution?

I also tried to use only one block actor for the job, but using interpolate and timers while changing the position seems to mess up the rhythm of the timer and alpha interpolation... Uuuhh... Im going insane here with this. For me, the best thing would be to have the same block on the exact same position, interpolating the alpha and activating and deactivating collision.

Hope this explanation is understandable!

/Seb

Comments

  • JDuaneJJDuaneJ San Francisco Member Posts: 300
    edited March 2014

    So if these blocks disappear and then reappear, I would just move them slightly enough to cause the collision to be removed, a couple pixels would do, it wouldn't be noticeable to the player. Ideally you shouldn't have to do this tho, once collision is removed that should be it...maybe a bug? How are you removing you collisions?

  • sebmat86sebmat86 Member Posts: 339
    edited March 2014

    @JDuaneJ said:
    So if these blocks disappear and then reappear, I would just move them slightly enough to cause the collision to be removed, a couple pixels would do, it wouldn't be noticeable to the player. Ideally you shouldn't have to do this tho, once collision is removed that should be it...maybe a bug? How are you removing you collisions?

    Thank you for replying. Yeah, I think I could do something like that. Just change its position a few pixels below. Gonna try that.

    This is how I have it right now, and it does work, so long as the actor does not have contact with the block, but again, when colliding with the block it won't work.

    When att. StoneMove1 = 0
    - Alpha to 1
    - Collide with player
    Otherwise:
    When att. StoneMove1 "is not equal to" 0
    - Alpha to 0

    So this is what I do and it works just fine on other objects that will appear if the games difficulty is Hard and disappear if the player chooses Easy or the other way around. And the only reason they work just fine is because the player does not collide with them in the beginning of a level. So I think it might be a problem within GS?

  • JDuaneJJDuaneJ San Francisco Member Posts: 300

    Things like this might require a feature request to completely turn an actors collision shape completely off or something.

    would be pretty simple if it were just: If "whatever" is "whatever" change attribute self.physics.collision to false. Otherwise change attribute self.physics.collision to true.

  • sebmat86sebmat86 Member Posts: 339

    @JDuaneJ said:
    Things like this might require a feature request to completely turn an actors collision shape completely off or something.

    would be pretty simple if it were just: If "whatever" is "whatever" change attribute self.physics.collision to false. Otherwise change attribute self.physics.collision to true.

    Yeah, I guess It would require that. It would be pretty convenient.

    I played around with different ideas. I did try moving the block a few pixels from the player, but I have one rule that makes the players speed drop down pretty drastically when overlapping the blocks. So even when collision is not active and the block is invisible, the actors speed would drop down. So having a lot of blocks all over the screen changing position, It felt like there was too much happening any way. But what I ended up doing was spawning a block actor that destroys after a couple of seconds. Seems to be the best solution for the game right now. Also when it comes to performance of the game. Less interpolates, position changes and timers running at the same time.

    But thank you so much for your answers! Really appreciate it! :)

    Cheers!

Sign In or Register to comment.