Lap Timers

Hello all,

I am having a few problems with lap timers.

1)My first problem is trying to position the timer in the top left corner of the screen. I am using @DeepBlueApps‌ helicopter template and have been playing with "Sin & Cos" and only manage to get the timer to remain static halfway up the left hand side of the screen using the following;

Constrain self.position.x to scene.dash.dash.position.x -115*cos(scene.dash.dash.rotation)

Constrain self.position.y to scene.dash.dash.position.y -115*sin(scene.dash.dash.rotation)

Any ideas on how to get the timer to remain in the top left corner? My camera size is Height 480 Width 320.

2)Secondly, I have tried several ways on how to set up a timer to display "0:00.000" but yet to find one witch works well and allows me to save the lap time into a table in order for me to display all of he lap times at the end of the race.

any help or pointer in the right direction is greatly appreciated.

@socks

Comments

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

    @ManxMann said:
    . . . . Any ideas on how to get the timer to remain in the top left corner? My camera size is Height 480 Width 320.

    I am going to assume the camera is moving - if so you can simply place your timer onto its own layer and disable 'scrolling' for that layer.

  • ManxMannManxMann Member Posts: 28

    @Socks said:I am going to assume the camera is moving - if so you can simply place your timer onto its own layer and disable 'scrolling' for that layer.

    If this works I think its time to find a new hobby, I've spent weeks messing with "Sin & Cos"

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

    @ManxMann said:
    If this works I think its time to find a new hobby, I've spent weeks messing with "Sin & Cos"

    Lol !

    Time spent with sin and cos is never wasted !! :smile:

  • ManxMannManxMann Member Posts: 28

    Still no joy,

    the layer the "lap timer" is on is already disabled 'scrolling'. Even when making a new separate layer, with disabled scrolling the 'actor' moves around the screen when the bike turns.

  • SocksSocks London, UK.Member Posts: 12,822
    edited July 2014

    @ManxMann said:
    Still no joy,

    the layer the "lap timer" is on is already disabled 'scrolling'. Even when making a new separate layer, with disabled scrolling the 'actor' moves around the screen when the bike turns.

    'when the bike turns . . . '

    ?

    Obviously there is a bunch of stuff going on in the game that no one, besides yourself, knows about, it's going to be difficult for people to make guesses as to how your games works, how it is set up, whether the camera moves or not (I have assumed it does, but that was just a guess, it might not be moving for all I know) . . .etc etc.

    Anyhow, hope you manage to sort it out . . .

  • ManxMannManxMann Member Posts: 28

    @socks Once the scene starts the 'bike' actor is spawned and the camera is constrained as follows:

    constrain scene.camera.oregin.x to self.postion.x -240

    constrain scene.camera.oregin.y to self.postion.y -160

    constrain scene.camera.rotaion to -self.rotaion

    The bike currently moves using the arrow keys on top of the race track (top down view).

Sign In or Register to comment.