boolean or switch on collision trouble

SnowSnow Member Posts: 124
edited November -1 in Working with GS (Mac)
Gamesalad won't let me use a boolean with collision. I have an actor A that on collision with a ground actor B resets its position to out-of-screen and where it touched the ground attaches an actor C.

I pool all my objects so that I don't have to spawn and destroy as from what I've read - destroyed objects are left in memory.

The problem is that I have a boolean set to go true if actor A collides with actor B... however nothing happens. I researched this and a suggestion from CodeMonkey I believe it was, was to use an integer as a switch:

game.Switch = 1-game.Switch

I've done that before in ActionScript and it worked well. Doesn't work at all in GS though.

Anyone have any other suggestions.

I think to better explain what I want to do is like Tetris. I want an actor to be like a falling block and fall into position. Except, that the falling block rather switches back out of screen and leaves a duplicate in it's place. All the duplicates are pooled off screen and I have working logic to make sure that only one is selected at a time. Due to certain events that happen, it is impossible to have pieces fall by themselves into place.. they can only be placed there by the single moving actor.

Comments

  • AjBlueAjBlue Member Posts: 215
    do you have a collision attribute on actor A saying that it can collide with your ground actor?
  • SnowSnow Member Posts: 124
    I tried everything, but I don't remember if I had a collision attribute on A... gonna try it out in a few minutes. It does reset it's position on overlap or collide.

    EDIT: Now, I tried everything. I can't get the boolean or switch to work for ANY condition... keypresses, x-axis > number, collision, etc. Is it because I'm trying to access the game.attributes from the prototype??? This is like my current class assignment - code a tic tac toe game in asp.net. It makes you want to go on a rampage.

    .. speaking of rampages, I could go on a coffee rampage right now.
  • SnowSnow Member Posts: 124
    Ok, so false alarm I guess. It was a strange bug with GS. I made a new file and used all of the exact same behaviours on both a local boolean and also a global boolean and both worked. The last file was a test file as well though. The game I'm working on will now have to be completely redone as I have the bug there as well. It will not, hell or high water change the boolean or any added attribute for that matter. >:(

    Anyway, don't delete this thread. This tidbit of info may be useful to others having the problems with the bug. Solution: start over.
Sign In or Register to comment.