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.
sync on : sync rate 150
GameTitle$ = "r" :
AuthorName$ = "" :
CopyrightDate = 2019 :
CompanyName$ = "" :
DIM GameCredit$(2) :
GameCredit$(1) = GameTitle$ :
GameCredit$(2) = AuthorName$ :
set display mode 1280,1024,32
middleX = 580 : score = 0 : draw sprites first
do
ink rgb(255,255,255),rgb(0,150,0) : set text font "arial" : set text size 36 : set text to bold : set text opaque
center text 640,450," "+GameTitle$+" "
ink rgb(255,255,255),0 : set text font "arial" : set text size 12 : set text to italic : set text transparent
text 495, 500,"DEVELOPED BY "+AuthorName$
ink rgb(255,255,255),0 : set text font "times" : set text size 20 : set text to bold : set text transparent
center text 640,800,"Press P to Play"
ink rgb(255,255,255),0 : set text font "arial" : set text size 14 : set text to normal : set text transparent
center text 640,760,"Copyright (c) "+str$(CopyrightDate)+" "+CompanyName$
if keystate(25) = 1 then gosub MainSection
sync
loop
MainSection:
sync off
sync rate 150
set text size 40
` set display mode 1280, 1024, 32
create animated sprite 1, "treadmill2.png",8, 1, 1
sprite 1, 0, 0, 1
size sprite 1, 1280, 1024
Load Image "character.png", 2
sprite 2, 600, 850, 2
rotate sprite 2, 90
set sprite priority 2, 1
Load Image "banana2.png", 3
sprite 3,RND (1000), -1000, 3
scale sprite 3, 65
Load Image "wall.png", 4
sprite 4, 0, 1428, 4
scale sprite 4, 500
Load Image "cupcake2.png", 6
sprite 6, RND(1000), -1000, 6
scale sprite 6, 65
load image "pizza.png", 7
sprite 7, RND(1000), -1000, 7
scale sprite 7, 50
load image "apple.png", 8
sprite 8, RND(1000), -1000, 8
load image "carrot.png", 9
sprite 9, RND(1000), -1000, 9
scale sprite 9, 75
load image "burger.png", 10
sprite 10, RND(1000), -1000, 10
scale sprite 10, 50
Load Image "wall.png", 11
sprite 11, 1400, 0, 11
size sprite 11, 1024, 5
rotate sprite 11, 90
` Load Image "[ic:mariostar][ic:mariostar][ic:mariostar][ic:mariostar][ic:mariostar]wall.png", 12
` sprite 12, -200, 0, 12
` size sprite 12, 1024, 5
` rotate sprite 12, 90
do
play sprite 1, 1, 8, 100
if sprite hit (2, 12)
delete sprite 2 : inc score,10
sprite 2, 1280, 850, 2
rotate sprite 2, 90
endif
if sprite hit (2, 11)
delete sprite 2 : inc score, 8
sprite 2, 0, 850, 2
rotate sprite 2, 90
endif
move sprite 10, -15
if sprite hit (4, 10) = 1
delete sprite 10 : inc score, 12
sprite 10, RND(1000), -400, 10
scale sprite 10, 50
endif
if sprite hit (2, 10) = 1
delete sprite 10 : inc score, 5
sprite 10, RND(1000), -400, 10
scale sprite 10, 50
endif
move sprite 9, -15
if sprite hit (4, 9) = 1
delete sprite 9 : inc score, 7
sprite 9, RND(1000), -400, 9
scale sprite 9, 75
endif
if sprite hit (2, 9) = 1
delete sprite 9 : inc score,6
sprite 9, RND(1000), -400, 9
scale sprite 9, 75
endif
move sprite 8, -15
if sprite hit (4, 8) = 1
delete sprite 8 : inc score, 9
sprite 8, RND (1000), -000, 8
endif
if sprite hit (2, 8) = 1
delete sprite 8 : inc score, 3
sprite 8, RND (1000), -400, 8
endif
move sprite 7, -15
if sprite hit (2, 7) = 1
delete sprite 7 : inc score, 4
sprite 7, RND (1000), -4000, 7
scale sprite 7, 50
endif
if sprite hit (4, 7) = 1
delete sprite 7 : inc score, 15
sprite 7, RND (1000), -400, 7
scale sprite 7, 50
endif
move sprite 6, -15
if sprite hit (2, 6) = 1
delete sprite 6 : inc score, 12
sprite 6, RND (1000), -400, 6
scale sprite 6, 75
endif
if sprite hit (4, 6) = 1
delete sprite 6 : inc score, 11
sprite 6, RND (1000), -400, 6
scale sprite 6, 75
endif
move sprite 3, -15
if sprite hit (2, 3) = 1
delete sprite 3 : inc score, 14
sprite 3, RND (1000), -400, 3
scale sprite 3, 75
endif
if sprite hit (4, 3) = 1
delete sprite 3 : inc score, 16
sprite 3, RND (1000), -400, 3
scale sprite 3, 75
endif
if keystate (32) = 1
move sprite 2, 15
endif
if keystate (30) = 1
move sprite 2, -15
endif
ink rgb(255,255,255),0
text middleX,10,"SCORE: " + str$(score)
loop
return
WinSection:
sync on : sync rate 150
GameTitle$ = "YOU WIN" :
DIM GameCredit$(2) :
GameCredit$(1) = GameTitle$ :
set display mode 1280,1024,32
do
ink rgb(255,255,255),rgb(0,150,0) : set text font "arial" : set text size 36 : set text to bold : set text opaque
center text 640,450," "+GameTitle$+" "
ink rgb(255,255,255),0 : set text font "times" : set text size 20 : set text to bold : set text transparent
center text 640,800,"Press P to Play Again"
if keystate(25) = 1 then gosub MainSection
sync
loop
return
So many games to code.....so little time.