Skip to content
Advertisement

I want this cube in pygame to move when I update it

My cube in which I am updating to move 5 pixels every frame, will not move. I have checked my code and I cannot find the issue, send pizza. I wish to make the cube move right 5 pixels every frame.

JavaScript

separate file

JavaScript

separat file

JavaScript

Advertisement

Answer

You have to create the instance of the Game class before the application loop:

JavaScript

The Cube must be created in the constructor of the Game class rather than in draw:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement