Score for distance

Get help using Construct 2

Post » Tue May 15, 2012 3:13 pm

Hi there

I have a game like jet pack joy ride, how would i go about making score for distance travelled with also the possiblity with adding coins to score to

Thanks for any help
B
3
Posts: 4
Reputation: 283

Post » Tue May 15, 2012 3:40 pm

How about using the distance function to check the distance?

Distance(instance1.x,instance1.y,instance2.x,instance2.y)

Where instance1 could be your jet pack and instance 2 could be a starting point. For coin count the number collected and times it by a score you want to give per coin.

Give it a shot ;)
B
19
S
5
G
4
Posts: 85
Reputation: 4,925

Post » Wed May 16, 2012 11:19 am

Thanks for the help, what would the code be for displaying the distance to a text box ?

Thanks
B
3
Posts: 4
Reputation: 283

Post » Wed May 16, 2012 9:19 pm

@randomrick, the Distance expression he gave is the code you'd use. There's more on the Distance expression, as well as expressions in general, at the following:

http://www.scirra.com/tutorials/77/native-expressions-in-construct-2/page-1

Also, it generally is much easier to provide assistance if you provide a .capx to show where you're currently at. It's easy to make adjustments and even add comments to other's .capx posts.
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Thu May 17, 2012 12:20 pm

Here you go i need the distance to appear in the top left corner, thanks for help

http://www.filehosting.org/file/details/343204/New_project.capx.backup1
B
3
Posts: 4
Reputation: 283

Post » Thu May 17, 2012 12:38 pm

Capx

Are you sure you went through the Beginner's guide for C2 ?
The part about the HUD is pretty much the answer.

Edit: Oh yeah also, I didn't download your file, because of boring filehost which requires clicks and advertisment and 3.9mo, it's probably already too much as far as download size goes.Kyatric2012-05-17 12:40:03
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,805

Post » Thu May 17, 2012 4:26 pm

Got it sorted thanks for all the help

<3
B
3
Posts: 4
Reputation: 283


Return to How do I....?

Who is online

Users browsing this forum: Callan S and 9 guests