why doesn't all actors with the same behavior act the same

mhmmamhmma Member Posts: 5
edited February 2013 in Working with GS (Mac)
I made a test game where tiles are moving when the player touches the edge of the screen (it seems that the player is moving through the stage - allthough only the tiles are moving)

all the tiles have the same behaviors, but they are not reacting the same way
that only happens at the first time the player hits the right or left side of the screen
the second time you try it all the tiles actually work like they should ...

you can download the gamefile here:
http://www.martin-hammerschmidt.at/test_game.zip

i hope somebody could answer the question :)

(sry for my bad english)

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Constrain Attribute self.position.X to self.position.X-10 seems like a really strange and unreliable way to move an actor. Why not just use a Move behavior?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SnapFireStudiosSnapFireStudios Member Posts: 1,603
    Yeah.. you want to be careful with using 'Constrain Attribute' behaviors that reference themselves, as these can be glitchy and you can create glitchy loops.
    - Thomas
  • mhmmamhmma Member Posts: 5
    thx - i tried it with move --- but i had to make some adjusting, because the actor doesnt move like a specific amount of pixels every time. so i had to check the difference so that there where no gaps between the actors when they were put on the other side of the screen ...

    thx for the answer! helped me a lot - and i now i also know that it isnt the best way to use constrain attributes ;)
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    That's strange. I replaced your constrain behaviors with Move behaviors (move 0 direction 300 speed; move 180 direction 300 speed) and saw no gaps. But if you have it working, that's the important thing.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Here's the same file with Move replacing Constrain Attribute.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.