How do I get the money to move with the character?
Applesauce Ninja
Member Posts: 13
I need help getting the money score ($) to move with the character. I am making a game similar to hill climb racing and the character works, so does the money. The scene is H-720 and W-10,000 if that helps. I know the $ needs to move on the x axis with the characters x axis. Can you leave a comment telling me how to do this?
Comments
The game is on my website, applesauceninja.moonfruit.com go to my games, then One-Wheel Drive. Not trying to advertise, just trying to get help.
There are a couple of ways you could do this but the easiest is just to put a Display Text behavior in the actor and have it display the amount of money/score. You can offset the position by changing the x and y values relative to the actor in the Display Text behavior.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
That makes complete sense! Thank you!
@tatiang Now that I try it, I'm not sure how to change the x and y of the display text behavior. Could you tell me exactly how to do this?
@tatiang I have the character displaying the money/score but it's displaying it on the character. I'm not sure how to change the x and y of the display text behavior.
I'm not sure whether the PC version of Creator has text position offsets as yet (?) but if it has simply enter a value other than 0.
Pc version does not. What if I took my project and offset the text on a Mac gamesalad. Would the pc version work with it when I edit it in the pc version?
No !
If you simply want one actor to track the X position of another you can simply constrain the following actor's X position to the leading actor's X position using a constrain behaviour.
Ok I'll try it
Make a game.attribute ('real'), let's call it HeroX
. . . . . . . . . . . .
In the leading actor - place a constrain behaviour that reads:
Constrain HeroX to self.x
. . . . . . . . . . . .
In the following actor - place a constrain behaviour that reads:
Constrain self.x to HeroX
@Socks This is what I've done:
Constrain Attribute
constrain: self.position.x to: __________
What do I put in the second blank? Did I put the correct thing in the first blank?
It looks like in hill climb racing the money count is part of the GUI, if you are asking how to create a non-moving GUI for a scrolling game, this video might help:
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Make a game.attribute ('real'), let's call it HeroX
. . . . . . . . . . . .
In the leading actor - place a constrain behaviour that reads:
Constrain HeroX to self.x
. . . . . . . . . . . .
In the following actor - place a constrain behaviour that reads:
Constrain self.x to HeroX
@Socks @jamie_c Thank you both, its working! Just have to do a little more work
you could try constraining the position of the player XandY then have the health display move to the attribute it is constrained to
That was already shown above.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS