Submit templates for repl.it/templates here.

← Back to all posts
Program/Game Starter Template!
h
Bookie0 (3285)

Hey everyone!!!

Hope y’all are chilling under the hot, summer, sun!
For those of you not off yet, stay strong, vacation will soon come!


Why you should use it

So this template is great for your programs. I think it’s even better with games. Just fork the repl, and many things will be already there for you.

When you code, you should try to make your code easy to read and also kinda beautiful. Also, you should try to follow the PEP 8 guidelines. (https://www.python.org/dev/peps/pep-0008/)

Files

The template has several files: the main.py (as usual), but also a names.py file with some names if you want them for your games.
There’s also a assets.py file containing these:

Comments

There are many comments that detail what each part of the original code template do. Feel free to take them off if you wish.


So yeah, I hope you like the template and use it.
Feel free to delete, modify, or copy and code.

Comments,tips, suggestions, etc. Comment down below!

And if you enjoyed it, Upvotin’s Carin’ !!! 😊 😃

Have a superb day!!! : D

Also! Which came first, the chicken or the egg?!

Write in the comments what you think!

Commentshotnewtop
WarriorDefender (3)

@Bookie0 Hey, can i talk to u On Discord? My Username : TheOriginalDude#0585

Bookie0 (3285)

Sure click on my username of repl for discord I put my tag in description @WarriorDefender

Bookie0 (3285)

Ok try it now I fixed it =) @dillonjoshua68

jaronvesser (1)

hey there is some thing wrong with golden survival it won't load

Bookie0 (3285)

? If you have a question post it in the ask @jaronvesser

jaronvesser (1)

@Bookie0 the golden survival simply won't load

Bookie0 (3285)

Uhh i cant help you why are you asking me? @jaronvesser

jaronvesser (1)

@Bookie0 you posted a game called golden survival and it won't load and idd like to play it

jaronvesser (1)

go to your profile page and click show more repls 2-3 times and it will be among those

Bookie0 (3285)

Oh I didn’t release it, I had that repl bc I was forking someone else’s to help them @jaronvesser

Bookie0 (3285)

Well yeah, they had a massive indentation problem, so i didn’t fix everything. Why were you interested by it? @jaronvesser

jaronvesser (1)

@Bookie0 I tried figuring. out what was wrong with it but I just confused my self

Bookie0 (3285)

Yeah, its just the indentation i think @jaronvesser

CoolJames1610 (556)

God created animals so the chicken came first :)

Jakman (377)

A class for names is pointless just use a list

Bookie0 (3285)

Yeah, I know, I’m takin it off @Jakman

Jakman (377)

@Bookie0 only use a class when you need a set of rules that multiple things should follow.

Bookie0 (3285)

What would be an example of that? @Jakman

Jakman (377)

@Bookie0 a class for a person. The person would have an age,name, and race. We all have one of these and we all follow these rules. But we do not all have the same. We will use a class to define these.

Bookie0 (3285)

Oh ok thx for the info @Jakman

Jakman (377)

@Bookie0 if you feel the need to ask questions about python ask me. I have written entire libraries in the language.

Bookie0 (3285)

Oh wow ok I will thanks @Jakman

firefish (308)

@Bookie0 Another example: a Player. They could have Health, Damage, Some special functions to cure and damage so you don't get an overflow, and a menu to choose what to fight with. A class is used to define them, so that any instance of your Player class will have all of the above. You can also inherit classes to create class with the same thing as other classes, but you override a few methods, and add some more. For example, Player, a class that inherits player, PlayerBlue. Different colloured players may do different things.

firefish (308)

@Jakman It's only a bit lengthy

firefish (308)

@Jakman I think that explanation is more C# oriented more than python

Jakman (377)

@johnstev111 it works. He isnt well in the way of OOP. New experiences will help him.

firefish (308)

@Jakman Because Python does this:
class PlayerBlue(Player):
as C# would do
class PlayerBlue:Player {
So I was getting kinda confused there because tbh I don't really understand self and all

Jakman (377)

@johnstev111 wow. I am slightly concerned about how many people that have not mastered OOP on this site...

firefish (308)

@Jakman C# is an object oriented language I have mastered OOP

Jakman (377)

@johnstev111 but have you done it in all languages?

firefish (308)

@Jakman all? like every single language in the repl list? Er.. no?

Bookie0 (3285)

@johnstev111
(That was a lot of messages going on between you and Jakman! XD)

firefish (308)

@Bookie0 I know... Back when I learnt C# (2.5 years ago) I was confused at first (object oriented programming; I got some experience of objects from when I was learning p5) But I got used to it. You shall too.

firefish (308)

@Bookie0 I made a similar game template in C# with classes and all, I'll translate into python for you. ;)

Bookie0 (3285)

Ok but I’m learning Python rn and c++ Later in July @johnstev111

Jakman (377)

@Bookie0 Ok but I’m learning Python rn and c++ Later in July Master python first bookie

Bookie0 (3285)

Yea but the course is just a small introductory one @Jakman

Jakman (377)

@Bookie0 CPP gets very complicated very quickly

NoelB33 (308)

Why are you using a class for names? Theres not really a point

Bookie0 (3285)

Idk, I was working in collab with another person and they had put a class so I kept it @NoelB33

NoelB33 (308)

Ok, but it’s kinda pointless @Bookie0

Bookie0 (3285)

Yeah, I might remove it @NoelB33

HahaYes (1052)

But why python.... why not C++

firefish (308)

@HahaYes I have a C# one if you wish, I don't know C++ either

HahaYes (1052)

@johnstev111 hmm c++ is also used for game dev too

firefish (308)

@HahaYes I remember back three years when I thought there were 4 languages starting with C:
C, C++, C#, and C+ (no typos there)

lightningrock (51)

So in a nutshell (or an eggshell, if you like), two birds that weren't really chickens created a chicken egg, and hence, we have an answer: The egg came first, and then it hatched a chicken.

The egg!

https://www.mnn.com/earth-matters/animals/stories/finally-answered-which-came-first-the-chicken-or-the-egg

lightningrock (51)

what do you think?

Which came first, the chicken or the egg?

@Bookie0

lightningrock (51)

also you missed or

Also! Which came first, the chicken the egg?!

it should be this:

Also! Which came first, the chicken or the egg?!

@Bookie0

Bookie0 (3285)

Tbh, idk. Maybe the egg just formed when the first bacteria and first living beings were made, in the water and everything, then the egg grew legs and ran out lol egg 🦵 🥚 🦵 @lightningrock

Bookie0 (3285)

Why are you spam pinging me? @lightningrock

lightningrock (51)

sorry but find the difference!
can you see the [email protected]

lightningrock (51)

oh well i guess my username is too long @Bookie0

Bookie0 (3285)

I’m busy now later maybe @lightningrock

firefish (308)

@lightningrock @Bookie0 Penultimate line first one it says Bookie00

firefish (308)

@lightningrock that took me all of 15 seconds tbh

Bookie0 (3285)

Please stop pinging me! XD @johnstev111

firefish (308)

@Bookie0 I said Cookie0... you weren't even pinged

Bookie0 (3285)

You were pinging me before tho @johnstev111

BobTheTomatoPie (1053)

I can see you got your names from me

Bookie0 (3285)

Yees, i did, and I added some others. But thanks! @BobTheTomatoPie

BobTheTomatoPie (1053)

ofc! I knew because my real name is in there and its spealt oddly as mine is irl @Bookie0

firefish (308)

The egg, because the proto-chicken laid this new chicken egg.

Bookie0 (3285)

What proto chicken? Also don’t you need a chicken for a egg? @johnstev111

firefish (308)

@Bookie0 Chickens evolved from proto chickens. A what point did something other than a chicken lay a chicken eg?

firefish (308)

@Bookie0 The point that a proto-chicken laid a chicken egg. There's your answer. The egg.

ShivankChhaya (78)

The egg came first. ALso really good!

Bookie0 (3285)

Thanks!
but if the egg cake first, how did it come? You need the chicken for the egg... @ShivankChhaya

ShivankChhaya (78)

@Bookie0 The dinosaurs laid eggs. People say a velociraptor looks a lot like a chicken. They probably laid eggs and through natural selection, IT BECAME THE CHICKEN!

ShivankChhaya (78)

@Bookie0 I said the egg came first.

ZDev1 (366)

Hope y’all are chilling under the hot, summer, sun! <

Nope!
After 4 days I'll have a vacation
But also not in the hot summer sun

Bookie0 (3285)

Oh, that’s annoying, but almost vacation! @ZDev1