Stopping an actor

24

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @diegolaya_ said:
    Exactly, since it seems I cant edit this forum anymore, people would have to go o the bottom of this topic to see my actual problem tatiang

    Yes, that's correct. Instead of us discussing where your next question should go, why not post it and see what kind of response you get? If it truly does fade away, then maybe a new thread is necessary but I'd like you to give it a shot here since we have rules about avoiding multiple threads for a single issue.

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

  • diegolaya_diegolaya_ Member Posts: 69

    If I have this rule
    http://es.tinypic.com/r/27xe44g/8
    ...................................................
    (Game.Right is a swipe to make the object go right)
    (Game.PAARTE is a real attribute changed for self.position.x)
    ...........................................................
    Why is my character only moving once? It moves twice his width and thats alright but I only responds to the first swipe, if I swipe again in the same direction, it doesn't move..

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Is that rule within an If Touch is Pressed rule? And are you changing the value of game.right and the value of game.PAARTE within that same rule? Because if you aren't, then the rules aren't going to trigger properly when you swipe a second time.

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

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang thank you, now it swipes everytime, the problem is that it moves a little more than twice its widht, and I need it to be as precise as possible. I think it might be because of the If self.psotion.x > PAARTE+self.widht (the bigger than).. What do you think?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I think it's possible. Have you tried equal to (=) ?

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

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang Yeah, that was the first thing I tried but it just keeps going, it doesnt stop I dont know why

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Me neither. Can you send me a link to download the project file (.zip it first and upload it to a file-sharing site)?

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

  • diegolaya_diegolaya_ Member Posts: 69
    edited January 2015

    @tatiang Hey! I tried .zipping the file, but when I tried opening it before uploading it, it opens gamesalad with no project on it, and I tried uploading it without zipping it but it says that the file is empty.. The only thing my project has is the actor and its rules, no images yet, maybe its because of that?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    No, it wouldn't be because of that. If you right-click on the project file, you should be able to "Send to .zip" or something like that:

    Upload that file and either post the link here or send it to me via private message. I'm not sure why testing it out didn't work for you but give it another go if you like and send me the link either way.

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

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang Ok, here's the link
    .........................................................................................
    http://www.mediafire.com/download/fdawd5wdkjpd64a/DODGY+ORIGINALl.zip
    .......................................................................................
    let me know if you were able to see the project, because when I open it this happens

    http://es.tinypic.com/r/2rlyv0n/8

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Hmm, yeah the .zip file is 142 bytes in size. It should be at least 100 times that big. So you're uploading an empty file as you suspected. Make sure you're zipping the folder itself and not just the .gsproj file inside of it.

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    That worked. I'll take a look...

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2015

    Something to note: both of your actors are unlocked on the scene which means that they are using "instance" rules that differ from the "prototype" rules you originally set up for them. Unless you have a very good reason to unlock actors, I recommend that you not do this. It makes things very confusing later on.

    So I see that you're using Change Velocity to move and then stop the actors. Why? It's a very imprecise way of moving an actor. Why not use Interpolate or MoveTo? It may be that you're planning on detecting collisions and Interpolate isn't going to work for that. One thing I would try is to change or constrain the x (or y) position when the ball actor stops. You can snap it to a grid by doing Change (or Constrain) Attribute self.Position.X to round(self.Position.X/self.size.Width)*self.size.Width.

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

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang Oh, I see.. I unlocked them to creat rules, I didnt know it would mess up things, how do I lock them again? I used change velocity because when I used move to it only moved 1 time.. And yes, I am planning on doing gameover by collision, and I want to do some kind of grid, so that the character moves ".." times in X position and ".." times in Y position and no more than that... So, I will try out what you told me and let you know! Thank you very much!!

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang Using a guide line I noticed that every movement is exactly twice the width, except for the first one, it exceeds the wanted number

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    You still working on this ! :)

    This works:
    (What you can see is everything, there are no hidden 'otherwise' rules or game attributes)

    Those four direction rules opened up:

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @diegolaya_ said:
    tatiang Oh, I see.. I unlocked them to creat rules, I didnt know it would mess up things, how do I lock them again?

    1. Create a backup copy of your file, just in case you need to restore it.
    2. Double-click on the actor in the scene and select all of the rules in the actor (click on a rule to select it and then click on the Edit menu and choose Select All). Click on the edit menu and choose Copy.
    3. Click on Revert to Prototype.
    4. Double-click on the actor in the Library. Select all of the rules and delete them. Click on the edit menu and choose Paste.

    Do that for all actors on the scene.

    tatiang Using a guide line I noticed that every movement is exactly twice the width, except for the first one, it exceeds the wanted number

    I'm not sure why that's happening but that's about all the time I can spend on this right now.

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

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang One last thing! How am I supposed to create rules by not unlocking an actor? Thank you

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

    Here are the above rules in action:

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks Wow man.... Im really shocked :o... Let me try it out! Thank you!!
    I'll let you know

  • diegolaya_diegolaya_ Member Posts: 69

    @Socks @Tatiang Finally!!! Cant thank you enough guys!! Sorry for taking too much time! :D

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

    @diegolaya_ said:
    Socks Tatiang Finally!!! Cant thank you enough guys!! Sorry for taking too much time! :D

    Changing the timer (currently at 0.02) will change the sensitivity of the swipe - adjust to taste.

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang‌ as you told me not to create another forum I preferred asking in this one that I already have.. I want my actor (Square) to be pulled by the horizontal lines that are moving down continuously by a move attribute and wrap Y. I tried with collisions but Im very confused. Can you help me?

  • diegolaya_diegolaya_ Member Posts: 69

    @diegolaya_ said:
    tatiang‌ as you told me not to create another forum I preferred asking in this one that I already have.. I want my actor (Square) to be pulled by the horizontal lines that are moving down continuously by a move attribute and wrap Y. I tried with collisions but Im very confused. Can you help me?

    @Socks‌

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    I'm not understanding what that means. :(

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

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang said:
    I'm not understanding what that means. :(

    Sorry :D , let me see if I can explain it better.. If you see right above theres a GIF from Socks, thats how my game it now.. The horizontal lines move down, like in "Dont touch the white tile" you know what I mean? So, I want my actor to move down with the lines unless I want it to move up to avoid the game over (If the actor touches the bottom of the scene you lose)... better?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2015

    Are the horizontal lines moving using a timer to adjust their position or are they in constant motion (e.g. Move behavior)? Either do something like every 2 seconds moveTo x=0 y=-40 relative to actor or use the same Move behavior in the square actor.

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

  • diegolaya_diegolaya_ Member Posts: 69

    @tatiang said:
    Are the horizontal lines moving using a timer to adjust their position or are they in constant motion (e.g. Move behavior)? Either do something like every 2 seconds moveTo x=0 y=-40 relative to actor or use the same Move behavior in the square actor.

    I make them move by a move behavior, and I turned Wrap Y on so that when a line goes down it reapears up to make it like an infinite loop... And I dont think every 2 seconds would work as the movement is continued, aaaand I tried applying the same rule to the square as well and it works, the only thing is that the swipe movement stops working.. I tried tagging @socks as he helped me with the swipe movement but I dont know if hes active right now.. Any ideas?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    My guess is that you'd have the Move behavior active only when the player is not swiping but I'm not sure.

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

Sign In or Register to comment.