actor doesnt collide when changing the size

IceboxIcebox Member Posts: 1,485

I am making a platformer , and i animated the coins but it drops the performance alot in gamesalad viewer and on older devices , so i decided to interpolate its width to make it look like it animates , but now it does not collide with the main actor , when i put it back to animation it collides normally. is this a bug or is there something im missing , I even tried setting it to moveable but same result.

1-Rule
if size width = 20
interpolate size width to 5

2-Rule
if size width = 5
interpolate size width to 20

3-Rule if overlaps or collides with hero
change attribute game.coin to game.coin + 1

the rule does what i want but the third rule doesnt work unless i remove the first two

Comments

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Physics won´t work when an actor is interpolating. You have to use another method to change the size if you want it to collide at the same time.

    Mental Donkey Games
    Website - Facebook - Twitter

  • IceboxIcebox Member Posts: 1,485

    @NipaDidIt but I usually interpolate the position of an actor and it collides with no problem

  • GnarlyGnarly canadaMember Posts: 840

    Interpolate actors and collide rules don't work together well.

  • SocksSocks London, UK.Member Posts: 12,822

    @Icebox1910 said:

    Try this:

    Timer: Every 0.04 seconds change self.width to [7.5 *sin( self.Time *200)+12.5]

  • IceboxIcebox Member Posts: 1,485

    @Socks it works! thanks alot its still heavy on performance though, i changed the coin to a diamond and added constrain rotation to rotation + 3 , added hundred coins and the frame rate did not drop , i dont get why (animation/ changing width) cause all of these issues, always thought that constrain is heavier on device but it seems to be better than animate behavior.

    thanks again

  • SocksSocks London, UK.Member Posts: 12,822

    @Icebox1910 said:
    . . . i dont get why (animation/ changing width) cause all of these issues, always thought that constrain is heavier on device but it seems to be better than animate behavior.

    It shouldn't really cause these issues, but of course no one can state categorically whether an animation will be more of a strain on the target device that any other behaviour because there are no details about your particular animation, maybe it's a series of 120 512 pixel x 512 pixel images running at 30fps, maybe it's a sequence of 12 32 x 32 pixel images running at 8fps, maybe something else entirely . . . . so it's hard to know what we are judging the constrain or interpolation against ?

  • SocksSocks London, UK.Member Posts: 12,822

    @Icebox1910 said:

    If you had a row of coins (common to platformers), you could set up just one coin actor, and then use replicate to produce a whole line of coins, with the number of replications being controlled by the distance between the coin actor and the player - so you could have a row of 500 spinning coins with very little strain on the processor, effectively it would only be handling a single coin actor (with a little additional overhead for the replicate behaviour).

  • IceboxIcebox Member Posts: 1,485

    @Socks oh i did not know that ! ill give it a try thanks

Sign In or Register to comment.