Custom collision help

devospicedevospice Member, BASIC Posts: 16
I'm developing a side-scrolling platform game and I need some custom collision detection since the bounce behavior isn't what I want to happen.

Basically, I want the character to walk by a vase on a table and knock it onto the floor. To do this I set the vase to not be movable. Then added a rule where if the character collides with the vase set the vase to movable. I expected the vase to fall to the floor at that point. (It has a collide with floor behavior already.)

If I set the vase to be initially movable then it falls to the floor as expected when I start the scene, but setting the movable attribute in a rule doesn't seem to work.

I've tried changing the velocity, acceleration, everything to make it move and nothing works. I can change the rotation, add particles, and change the actor's image, but I can't get it to move.

Am I doing something wrong or did I find a bug in GameSalad?

Thanks.

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited July 2013
    I don't think the "moveable" option is changeable during gameplay, but I could be wrong.

    Why is it that you can't just use collide to control your collisions?
  • LumpAppsLumpApps Member Posts: 2,881
    I do not believe you can change movable in run time.
    Do you use gravity? If not make the vase movable.
    Then in a rule say
    when colides with actor "character"
    accelerate 1000 down. (270 degrees)

    Hope this helps.
  • devospicedevospice Member, BASIC Posts: 16
    I'm using collide but I don't want to use the bounce behavior. The main reason is that I want the effect to be the character walks past the vase and then it just falls down. But the other issue is I don't want the character to be able to walk on it.

    The vase is on a table. The character can walk in front of the table or stand on it. Yes, I'm using gravity. I can make the vase collide with the table but then there's no way for it to fall straight down. (Can I remove a Bounce behavior at run time? I don't think so.)

    It seems odd that the movable attribute can't be set at run time. If that's the case then I shouldn't be able to select it from the menu.

    I may not be able to do this. I may have to just have the character push the vase off the end of the table.
  • devospicedevospice Member, BASIC Posts: 16
    OK, I figured out how to get my desired effect. I set the actor sprite to collide with the table. Then when the character walks in front of the table or otherwise collides with the vase I destroy that actor and spawn a new one. The prototype does NOT collide with the table which makes it fall to the floor. Then I play a nice little crashing animation when it hits and presto!

    By the way, I am LOVING GameSalad. I've been programming video games using one technology or another (mostly in Director) for about 18 years. I think I've found my new development environment! Now, just please don't go the way of Director. :)
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Wow, I haven't thought of or head the name Director in ages! That was awesome for its day. :)
Sign In or Register to comment.