Actor goes faster and faster

EpicoreGamesEpicoreGames Member Posts: 188
edited January 2015 in Working with GS (Mac)

I set my game like this

I set it to change attribute self.position.X to random(30.25,533.672)
and another change attribute self.position.Y to 353.965
when self.HP = 0

i set when the actor is being pressed , change attribute self.HP to 0 and so calls the change attribute function

but it keeps going faster and faster when i clicked on it ( and it comes down from top and that's what i want ) just the speed is keep increasing per time and i didn't set anything on its acceleration i mean , i did not set anything to change the acceleration so why it is going faster ?

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803

    The changing of position does not affect the speed of an actor. So what you are seeing is something like a wormhole or like in Portal. Speed going in at one side of the portal is the same as when it comes out at a different location.
    If you want to reset when HP=0, you need to reset the speed too. A Change Velocity behavior to 0 speed will work, or you can use 2 Change Attribute behaviors to modify the X/Y velocities.

  • Thunder_ChildThunder_Child Member Posts: 2,343

    Speedy thing goes in...speedy thing comes out.

  • EpicoreGamesEpicoreGames Member Posts: 188

    oh god..... every time i got solution fixing one thing and another error pop out arghh...

    now i don't know what behaviors have i accidentally deleted or what, it just lets me click 1 time , and the next time it comes down , i can't click on it ....

    i got this error before and i fixed it but now i don't know why it occurs again...

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

    I recommend uploading your project file to a file sharing site such as Dropbox or MediaFire and then posting the download link here. That way we can see your rules and how your scene functions.

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

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

    @ssam5512 said:
    I set my game like this

    I set it to change attribute self.position.X to random(30.25,533.672)

    The random function produces an integer, there's no point putting decimal points into the high and low range values as they will be ignored.

  • EpicoreGamesEpicoreGames Member Posts: 188

    hi all , i got another problem here .
    when my actor comes down , i click on it so it goes back to top and comes down again , but this time i can't click on it !
    What behavior should i add to let it enables me to click on it every time it comes down?

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Use a Rule with a condition that reads When Touch Is Pressed, then do your actions...

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

    I'm going to repeat what I said here:

    You'll need to provide more details than just "actor comes down... can't click on it." Type out the rules you're using or paste a link to a screenshot you've uploaded to a file-sharing site or at least be more descriptive.

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

  • EpicoreGamesEpicoreGames Member Posts: 188

    lol why do you keep staring at me movement? go checkout other user's post :disagree:

  • EpicoreGamesEpicoreGames Member Posts: 188

    i set my actor to comes down and when i click on it , i want it to come down again and it did work.
    However, when it comes down for the second time , i can't click on it
    here's the pictures
    http://postimg.org/image/a4biurb0f/

    http://postimg.org/image/bfut725bl/

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

    @TechnoApps said:
    lol why do you keep staring at me movement? go checkout other user's post :disagree:

    He's trying to help you out - that's what these forums are for - and his point is valid, if all the information you supply is 'i can't click on it' then you are making the job of helping you sort the issue out very very difficult.

  • EpicoreGamesEpicoreGames Member Posts: 188

    Okay i am really sorry . So I had made a new post with pictures in it . Could you help me out with it ?

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

    /merged

    Please don't keep creating new threads for the same issue. Simply add a new post to the existing thread.

    Why are all of your attributes blank? For example, in the When Touch is Pressed rule, you're changing an attribute to 0. Which attribute is that? Use a Log Debugging Statement to make sure that rule is actually firing. Also, try deleting that actor from the scene and re-adding it. Does that make it work?

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

  • EpicoreGamesEpicoreGames Member Posts: 188

    that may be a bug or what . But it did contain attributes. I'll try take another picture again

  • EpicoreGamesEpicoreGames Member Posts: 188
    edited January 2015

    hi guys . here are the new pictures with attributes . please help me for the problem i faced as mentioned before.

    1.http://postimg.org/image/g9y8bppej/

    2.http://postimg.org/image/b4hzvotev/

  • EpicoreGamesEpicoreGames Member Posts: 188

    ..

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

    When you click on the actor, it resets its position but it continues to accelerate because that's the behavior you gave it. It doesn't somehow know to stop accelerating when it resets position. If you want it to slow down or not pass a certain speed, you have to program that in.

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

  • EpicoreGamesEpicoreGames Member Posts: 188

    But the problem is it just let me click on it one time . The second time it comes down I can't click on it and the later behavior could not execute .

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

    Does this happen if you create a new, blank scene and add the actor to it?

    Post a link to download your project file (.zip it first).

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

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

    Is there a reason you have three copies of the Ball_2 actor on the scene? You can see that by going to Scene-->Layers-->Background.

    Regardless, your When Touch is Pressed rule is working just fine. It changes self.HP to 0 both times you click it. The problem is that once self.HP is set to 0, it triggers the rule, but the second time you set self.HP to 0 it's already zero so it doesn't trigger the rule again. Rules only trigger when their condition changes from false to true, not when it remains the same (true to true).

    To fix this, have one rule that says When Touch is Pressed and self.HP=1 and have another rule that says When Touch is Pressed and self.HP=0.

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

  • EpicoreGamesEpicoreGames Member Posts: 188

    Thank you all for helping . The problems have been solved :D

Sign In or Register to comment.