Ask coding questions

← Back to all posts
Displaying scores
DEMONul1234 (54)

So I created that code here, but don't know how to make score appear on a turtle window

Comments
hotnewtop
PattanAhmed (1412)

@DEMONul1234 Hi,
You can follow this awesome tutorial to find out how to make a perfect Pygame game.
Click here and you are done

You can fast-forward until your part of clarification is shown

Hope this helps
Please mark my answer if this helps

Muffinlavania (1527)

@DEMONul1234 !!!! I literally just made a game with this concept here it is
https://repl.it/@Muffinlavania/Super-Blaster
In the code you will see a turtle named scorekeeper, that the one that does it (Also play the game because to me it is very fun, i would full screen the turtle window)
oh wait.. this is pygame idk

DEMONul1234 (54)

@Muffinlavania Yea, it is pygame. Figured doing it with turtle would be less...interesting

[deleted]

I would use:

screen.title("Score: " + score)

If that doesn't work let me know, I don't really know much about python with turtle so I'm just making a guess on the fly.

DEMONul1234 (54)

@GoofyGus It does not work. Well 'title' is not an attribute for pygame, so nope... also int cannot be added to 'set_caption' which actually defines title.

[deleted]

Yeah sorry, I don't know much about pygame and stuff, maybe you need something like this?
https://techwithtim.net/tutorials/game-development-with-python/side-scroller-pygame/scoring-end-screen/
@DEMONul1234

adl212 (172)

@DEMONul1234

also int cannot be added to 'set_caption' which actually defines title.

You should replace score with str(score)