playMaker

Author Topic: Player movement in Runnergame  (Read 2763 times)

Mysonye

  • Playmaker Newbie
  • *
  • Posts: 15
Player movement in Runnergame
« on: April 14, 2018, 05:12:56 PM »

hello together, I'm doing a runner game and have problem with turn.

How can I do that I turn off the road before crossing? Similar to Temple Run.

I want to play the game on Android and can currently only run left and right in the middle.

I can not find anything on the internet how to do that.
Rotation and translate works but how do I do that I can only turn in a certain street?

my example picture



thanks. MySonye.

Sorry for my bad english

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Player movement in Runnergame
« Reply #1 on: April 15, 2018, 05:26:34 PM »
Hi,
1st of all your player must be in a parent that should always be in the center from the road. and the player moves locally.

Then you should have some positioning points on the road where the parent can move/rotate to and a trigger where the parent should start to rotate.

I just recently made a protoype for someone, but i used an asset called Dreamtech Splines

Mysonye

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Player movement in Runnergame
« Reply #2 on: April 20, 2018, 12:13:41 PM »
Thank You very much :) its work :)


Can I ask something else? I have a ""Get timespan between dates"" feature and I want to replenish energy% every 5 minutes. the question is: how do I set Get timespan between dates 5 minutes to start the timer?
Do I must to split string?

jesimielxd

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Player movement in Runnergame
« Reply #3 on: April 20, 2018, 06:56:47 PM »
just add a trigger at the exact point you want to turn player, and set rotation and add smooth look at.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Player movement in Runnergame
« Reply #4 on: April 21, 2018, 01:29:27 AM »
Hi.
State 1:
1st you need to get the time with for example "get system date time"
and set a start date on a variable.

State 2
Place also a "get system date time" and set every frame.
On the "Get Time Span Between Dates" set 'Get Span Info' to 'Total Minutes'
Then you can use a float compare and check if greater than 5
if greater do what you need to do and then go back to state 1.

if you only need this while in game (so without leaving the game) you could use the "Get Time Info" action and set 'Get Info' for example to 'Time In Current State'
And Store the value.

The value is in seconds so you would need to compare it to 300 (for 5 min)

Mysonye

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Player movement in Runnergame
« Reply #5 on: April 25, 2018, 11:55:31 AM »
Thank You djaydino


I tried everything and it does not work.
what should I do at Start Time? I'm doing at Start Time Current Time
and what should I write at End Date? Do I have to create float variable? can you please make an example? I have been sitting for 2 weeks and can not continue.

I thank you in advance


Mysonye

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Player movement in Runnergame
« Reply #6 on: April 25, 2018, 01:11:29 PM »

I think it worked? But time is always moving forward. Can I do it like this? 4:59 4:58 4:57 that time is going down?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Player movement in Runnergame
« Reply #7 on: April 25, 2018, 02:38:48 PM »
Hi.
There is an action i made called 'Countdown Timer' on the Ecosystem

Its in seconds, so for 5 minutes you should set it to 300.

Then you can use 'Convert Seconds To String' and set the "Format" the way you want to display it.

Mysonye

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Player movement in Runnergame
« Reply #8 on: April 26, 2018, 03:52:30 AM »
Thank you very much it works. I´m Sorry for asking several different questions in one topic instead of creating a new topic.

May I still ask, why is my INT or FLOAT in Global Variable not adjustable? is that normal?

Example:
I have 3 magnets (int or float = 3 in Global Variable)

i do INT (or float) operator and if i subtract 1 then i get subtract right in global variable. After several game starts, this does not work anymore. By subtracting magnets are changed from 3 to 2 and immediately reset to 3
is global variable read-only?

can it be that global variable can only be described once?

I apologize for my English again: /

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Player movement in Runnergame
« Reply #9 on: April 26, 2018, 05:43:13 PM »
Hi.
There is probably something wrong in your logic as globals should work the same as local.

But you should avoid using globals, its better to have the variables local and use set/get Fsm actions to get set the variables.

There are also several custom actions on the Ecosystem.
For example : Add To Fsm Int / Fsm Int Changed / Fsm Int Compare...and so on.