Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / I'm trying to implement a score into the game but it won't increase (sorry if the code is a little messed up I had to get this from PC to Mac which doesn't have a usb drive)

Author
Message
BaconMaster
5
Years of Service
User Offline
Joined: 30th Apr 2019
Location:
Posted: 30th Apr 2019 06:13 Edited at: 30th Apr 2019 06:25
I'm new to this program and have a project due in a few weeks for school and im almost done with my game but can't figure out how to get the score to increase when it hits the objects in the game. I know its not well written code but can someone please help me figure out what to do.


Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Apr 2019 06:26
You had the open tag for DBPRO but not the closing tag so as it displayed on the forum properly
I did a mod edit and fixed that
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
BaconMaster
5
Years of Service
User Offline
Joined: 30th Apr 2019
Location:
Posted: 2nd May 2019 06:55
What's an open and closing tag? I have no idea what I'm doing.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 8th May 2019 04:30
I think he is talking about when you post code here, you have to click the CODE button (select Misc code) then paste your code and then click the CODE button again and select Misc Code again in order to correctly display the code in a snippet.

Anyway, as to the code, you did not have any variable for keeping the score in the code. Establish a variable and increment it when the player collides with an object. I added this in the code I am posting here (I just picked random amounts). Also, with your treadmill animated sprite covering the screen, you will never see any text printed unless you put in the command, DRAW SPRITES FIRST early in the code. This does all the sprite drawing before the text commands, so you can actually see the text on the screen. Again, I included this in the code. Took a screen grab of it.




So many games to code.....so little time.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-14 16:37:01
Your offset time is: 2024-11-14 16:37:01