Bounce of the wall while moving an actor with a finger

YogamattaYogamatta Member Posts: 27
edited November -1 in Working with GS (Mac)
I am doing a small demo for iPad. I could install GS viewer and publishing works as well. Let me say that I am a new user and had a clean installation. I haven't bought Pro version either.

Well, to the problem then. I have an actor which I move with a finger. Now I want it to bounce of the walls so I can't just jump through the walls. I can't figure out how to do this.

Another problem is displaying text. Is it possible to choose another font besides the fonts in the list?

Thanks in advance

Comments

  • YogamattaYogamatta Member Posts: 27
    Well, after waiting for a while I searched the forum and found the answer to my questions. No one has done it before and it's not possible to use other fonts to display text. Numbers are ok but I couldn't find the example. The link was broken.

    But... I figured out how not to move through the walls! It's not the best solutions but it works as long as it doesn't go too fast.

    I define an attribute for the actor which I move with a touch, let it call okToMove and it's a bool. I set it to true as default.

    Rule 1: how to move the actor
    Actor receives event touch pressed AND okToMove is true -> constrain attribute x and y to touches' x and y.

    Rule 2: the collision
    Actor overlaps/collide with actor wall AND okToMove is true -> set okToMove to false.

    Rule 3: reset so we can move the actor again
    Actor receives touch OUTSIDE -> set okToMove to true.

    Works ok. But if you move the actor to fast you can still pass the wall as collision with the wall never registers.

    Happy hunting!
  • juzcookjuzcook Member Posts: 259
    I had the exact same problem when I started using GS and tried a number of tricks using hidden triggers, but if you move it too fast it always seems to go through the walls. So as far as I know, there's no workaround for this yet :(
  • steve86steve86 Member Posts: 806
    yogamatta i had the same issue with the walls... and I did exactly what you proposed but then I also found out that if you move it really fast it wont detect it and you can still go outside of the screen and come back again..

    So what I did was make an out of bounds rule... if the player attemps to move the ball outside viewing area a you loss menu will appear with an out of bounds leyend... that way people will inbounds :)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Yes you can use different fonts. Look in the demos and tutorial for it.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    And im guessing your collosion problem lies with the touch outside rule, not sure though, im looking into it now for you.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Try putting an invisible actor over the whole screen where you want the touch rules to apply. Have when actor overlaps or collides with the invisible actor And when touch is pressed move. Then it only moves when its inbounds. I just tried it and it works fine, but im trying to find alot more effiecent way for you though
Sign In or Register to comment.