Skip to content
Sign upLog in
← Back to Community

Game not working

Profile icon
devcoder10

Hello, I am a beginner in coding and I made my first Repl today.
It was a pygame of Space Invaders game.
But when I run the code there is so much lagging. The code is looking fine. But I don't know why it lagging this much.
Someone please help me.
Edit: The project is not yet completed.

Voters
Profile icon
MaksymGladun
Profile icon
devcoder10
Comments
hotnewtop
Profile icon
PattanAhmed

@devcoder10
Hi,
Yes, you are correct!

Pygame is a little bit laggy on Original Python Repl
So, Copy-Paste all your code to newly create Pygame Repl

01


or

Click here to make one automatically.

Try

Thanks!
With my best wishes
Hope this helps

Profile icon
Coder100

That's repl.it's problem, not yours. I think its something about the interval each frame gets executed and your internet.

Profile icon
devcoder10

@Coder100
Oh, ok.
So my code is fine.

Profile icon
Coder100

yep :)
if you run it locally you will see it works great

@devcoder10

Profile icon
InvisibleOne

I don't really think it is any problem, in my experience pygame on repl always seems to be a bit laggy

Profile icon
devcoder10

@InvisibleOne

Ok thank you for that.

Profile icon
StudentJasonJa2

you could run it through some debuggers or it could be that repl doesn't support a type of command. That happened to me in html

Profile icon
devcoder10

@StudentJasonJa2

Please tell where I can debug that. I tried with the debugger in Repl.it itself. But I couldn't figure out how to use it.
Also please tell that which command didn't work in HTML as I have a plan to create an HTML, CSS multiplayer replit with my friend soon afyer exam😁

Profile icon
StudentJasonJa2

honestly idk wts wrong.

Profile icon
StudentJasonJa2

This is ur first? WOW!

Profile icon
devcoder10

@StudentJasonJa2

Yes it is my first Python project. I learn to code from freecodecamp. In that I am actually learning Javascript. But when I saw Pygame in Replit I thought I can learn it. So I watched the pygame tutorial in freecodecamp youtube channel. That's how I learned to make Space Invaders but the game isn't complete yet.