gamesalad is complex !!

PowerKalistoPowerKalisto Member Posts: 34
edited November -1 in Working with GS (Mac)
hello ... I got this rule for my actor that everyones knows by ''faceleft'' :

http://img163.imageshack.us/img163/523/image1ic.png

but i have also this rule wich makes my actor teleport and there is the problem... when my actor touches the teleport, the first time it goes very well but when my actor touche it the second time the teleport work only in a side ... it can be the left, it can be the right but never both ... i think the problem is my faceleft rule but I can't change it because it works for my shoot rule (I can't shoot proprely if I change it ) ... do you guys understand ?... because I know it can be hard to understand me ... if there is any question just ask !!

Oh i forgot to say ... the main image is a men looking at right ! but when I do ''preview'' he's looking left ...

Comments

  • iDeveloperziDeveloperz Member Posts: 1,169
    Maybe my steve's adventures template will help you. :)

    Here you go my good man, http://gamesalad.com/game/play/45517
  • rebumprebump Member Posts: 1,058
    Can you show your teleport code/logic?

    I would surmise you could add a rule to the actor if collision/overlap with the actor AND faceleft then teleport left behavior(s). Otherwise, teleport right behavior(s).

    You could also (instead) test for the collision/overlap and the X velocity of the actor.

    Or maybe I am misundertanding what you are stating.
    .
    .
    .

    The problem with either method would be if you walk one direction into the teleport and then walk back (i.e. turnaround) really (!!) quick before the teleport may actually occur and then you teleport the opposite way that you thought you were going to teleport. This may or may not occur depending on how bogged down your game is and how long the teleport behavior(s) take to execute. You may need to add a "PlayerIsTeleporting" attribute that only allows teleporting to begin if it is 0 or false, set it to 1 or true while teleporting is going on, and then back to 0 or false one teleporting is complete. Again, this may only come into play if your game is already pretty slow in terms of performance.
  • PowerKalistoPowerKalisto Member Posts: 34
    @ Rebump
    I used this demo (made by tshirtbooth) to do the teleport :
    http://gamesalad.com/game/play/26168
    @iDeveloperz
    sry man but it's a little more complex than that but thanks for the help !!
  • PowerKalistoPowerKalisto Member Posts: 34
    Ok i think i got it ... when my actor is passing the next level and he is looking right ... in the next level he'll look right but if he pass the leve while looking left he spawn to the next scene looking left and that's the problem ... how can i make the actor spawn looking right whatever is the condition !
  • rebumprebump Member Posts: 1,058
    Not on a Mac at present, so I cannot look at TSB's demo. However, in the behavior that causes the teleport...just add a "change attribute" that sets the player "FacingLeft" attribute to "1" to denote facing left (used "1" based on the content of the screen shot above). If you place that right before the "next scene", then upon next scene load, the player should be facing right. You may need to put the "next scene" in a short timer delay to allow the "change attribute" time to run.

    Side note: Usually with an attribute/variable/parameter name "FacingLeft", "1" would indicate "true" or "facing left"...so your example was a bit misleading. I can see "0" meaning left and "1" meaning right based on their position on a line graph. But in that case, it may be better to name the item "FacingRight". ;-)
Sign In or Register to comment.