Ask coding questions

← Back to all posts
Games in Python
GIORGOSMENTES

I'd like some help, could anyone teach me how to write games in Python?

Voters
Ram-jiji
17Kalraa
mgcodes
GIORGOSMENTES
Comments
hotnewtop
multicoder2021

Well, @GIORGOSMENTES, I got just the thing you've been looking for, the Ursina Module.

It's very, very good.

Search Minecraft in Python by Clear Code on Youtube or if that doesn't work search Minecraft in Python.

I'm not allowed to give the link

I'm also working on an Ursina Tutorial.

YOU CANT DO THIS ON A MACBOOK

Just download/install any editor, other than replit, press Windows + s, and search Command Prompt, then open it.
Then type in Command Prompt this code:
pip install ursina
Wait for it load...
Then go back to the editor.
Then copy and paste this code and run:

With these 14 ASTOUNDING lines of code, you can make this object move.

Ursina also has many inbuilt features.

I'll just do a short summary of this code:
LINE 1: Star Import, imports everything out of Ursina.
LINE 3: [There is an inbuilt function called held_keys[] which gets the key pressed , instantly.]
LINE 4 PART 1: test.y += 1: Imagine a grid with an x and y line. As the y line gets higher, so does the coordinates. So this moves it along the y line.
LINE 4 PART 2: * time.dt: This makes sure the code runs and the frame rate, so that it isn't too fast.
LINE 14: Defines an Entity called test. The model is the shape. The options are: circle, quad, sphere, cube and more. Quad is a square.
The texture is the decoration on it. This can be a local image, OR an inbuilt texture.
LINE 15: Runs the code.

I'm beginning to think this comment is getting a BIT too long, so I'll stop myself before I can type any further.
Hope you can UnDeRsTaNd it

ash15khng

You could try the pygame module, however it is not supported on [repl.it] now.

RyanRana

Cool, I like making games in python! What level of python are you at beginner, intermediate, or advanced. If you are advanced I recommend downloading python and start learning tkinter.

PYer

How much python do you already know, and what do you want your game to be like?

GIORGOSMENTES

@fullern000 I've been learning for 2 years and I'm beginner to intermediate

PYer

@GIORGOSMENTES Hmmmm... What game are you making? A tic-tac-toe type or more of a dungeon adventure?

GIORGOSMENTES

@fullern000 a very simple one

kaldisberzins

Python is not the best language for games. It does not really have support for image output which makes games difficult. You have two options for making games in python. 1: Make a text based game using print() and input() where the person reads some text and then can write something that changes something and spouts some more text. Or 2: Use the python turtle library to make a game but be warned: it is a pain in the *** to do anything with it. https://docs.python.org/2/library/turtle.html.