Omnimaga
General Discussion => Technology and Development => Computer Programming => Topic started by: Sorunome on May 24, 2013, 10:01:55 pm
-
Hey, i've been working on pong with pygame, and it is working! :D
The only question i have to you guys is - did i do something fundamentally wrong because on my raspberry pi it only runs with low fps and on my lappy it runs with 30, what takes it so much calculation power?
-
Yay Python :D I haven't worked much with pygame yet, so I don't think I'll be able to help. When I run it however it goes fullscreen and crashes pretty much instantly.
-
wut, what does the terminal output you?
-
Atm on windows, the console didn't output anything but IDLE said:
Traceback (most recent call last):
File "C:\Users\Gebruiker\Downloads\pong.py", line 189, in <module>
main()
File "C:\Users\Gebruiker\Downloads\pong.py", line 182, in main
moveStuff()
File "C:\Users\Gebruiker\Downloads\pong.py", line 148, in moveStuff
ball.move()
File "C:\Users\Gebruiker\Downloads\pong.py", line 76, in move
quit()
File "C:\Users\Gebruiker\Downloads\pong.py", line 11, in quit
sys.exit()
SystemExit
I'll test at linux soon.
-
that is normal if you lose >.<
idk why but idle gives errors on sys.exit()
-
It is extremely laggy on my Linux system, runs at about 2fps. Might have to do with AMD's crappy 2D performance on Linux, but it can't be *that* extreme. Also, it spreads over my two screens which gives a funny effect.
-
lol, i just set it to fullscreen, maybe it is quicker if i enable hardware thingy for graphics?
-
I guess it is, especially for the Pi, which has a relatively powerful GPU compared to the CPU.
::EDIT:: When I changed it to HWSURFACE, it only slowed everything down even more :(
-
Hey, if i run it on my pi before startx it will only start x for pong and it runs on normal speed!
Hurray! :D
-
What version of Python do I need to play the game?
-
I assume it should run with Python 2.7 with the pygame library installed obviously. And it does. It doesn't run in Python 3 though.
-
Ah ok. I think I have version 3 installed, since it just closes immediately after opening (I only get to see the command line thing)
-
I assume it should run with Python 2.7 with the pygame library installed obviously. And it does. It doesn't run in Python 3 though.
yes, 2.7
and I just noticed a misstake, for the fps instead of 1000/30 i put 30/1000, that would explain why it runs so slow on my pi >.>