gamesalad is complex !!
PowerKalisto
Member Posts: 34
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 ...
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
Here you go my good man, http://gamesalad.com/game/play/45517
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.
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 !!
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". ;-)