-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added code, config and script to run a pygame app on the RG350.
- Loading branch information
0 parents
commit b21218f
Showing
5 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import sys, pygame | ||
pygame.init() | ||
pygame.joystick.init() | ||
|
||
size = width, height = 320, 240 | ||
speed = [2, 2] | ||
black = 0, 0, 0 | ||
|
||
screen = pygame.display.set_mode(size) | ||
|
||
ball = pygame.image.load("icon.png") | ||
ballrect = ball.get_rect() | ||
|
||
while 1: | ||
for event in pygame.event.get(): | ||
print pygame.event.event_name(event.type) | ||
if event.type == pygame.KEYDOWN: | ||
print "Key: ", event.key | ||
sys.exit() | ||
|
||
ballrect = ballrect.move(speed) | ||
if ballrect.left < 0 or ballrect.right > width: | ||
speed[0] = -speed[0] | ||
if ballrect.top < 0 or ballrect.bottom > height: | ||
speed[1] = -speed[1] | ||
|
||
screen.fill(black) | ||
screen.blit(ball, ballrect) | ||
pygame.display.flip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rm -f bouncing_ball.opk && \ | ||
python -m compileall ./ && \ | ||
mksquashfs default.gcw0.desktop ball.pyc icon.png intro_ball.gif bouncing_ball.opk -all-root -no-xattrs -noappend -no-exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Desktop Entry] | ||
Type=Application | ||
Name=Bouncing Ball | ||
Comment=Bouncing ball example extracted from pygame tutorial | ||
Exec=python ball.pyc | ||
Categories=games; | ||
Icon=icon |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.