maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Games (https://talk.maemo.org/forumdisplay.php?f=12)
-   -   QBASIC Gorillas on N900 (Python) (https://talk.maemo.org/showthread.php?t=69887)

stlpaul 2011-02-15 16:15

Re: QBASIC Gorillas on N900 (Python)
 
BTW last year there was a Gorillas 2 (for MS-Windows PCs) which has new types of bananas and online play.

next you can try to find a DONKEY.BAS for n900 ;)

StefanL 2011-02-15 16:43

Re: QBASIC Gorillas on N900 (Python)
 
Try installing on of the Python based programs (PyGTKEditor, gPodder); that should fix some missing Python dependies on your N900, or do an apt-get install pygame :).

epage 2011-02-15 16:48

Re: QBASIC Gorillas on N900 (Python)
 
I believe the package is python-pygame that you are looking for. A good way to check is
Code:

apt-cache search pygame
Since you are already running experimental software, Omnom from extras-devel will pull in the right deps.

xxxxts 2011-02-15 17:27

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by epage (Post 947167)
I believe the package is python-pygame that you are looking for. A good way to check is
Code:

apt-cache search pygame
Since you are already running experimental software, Omnom from extras-devel will pull in the right deps.

Already had PyGTKEditor installed - I am now installing pygame. I will give this a try myself as well.

xxxxts 2011-02-15 17:30

Re: QBASIC Gorillas on N900 (Python)
 
Code:

./gorilla.py: line 19: Hello, and welcome to the source code of Gorillas.py. This program is meant to be very well documented so that a
novice programmer can follow along. This program was written by Al Sweigart as a companion for his free, Creative
Commons-licensed book Invent: File name too long
: not foundy: line 20:
./gorilla.py: line 21: import: not found
./gorilla.py: line 22: from: not found
./gorilla.py: line 25: We'll import quite a few modules for this game. pygame has all the graphics & game-related functions that the
Pygame game engine provides. sys has the exit() function. time has the sleep() function. random has the randint()
: File name too longontains the pi constant.
: not foundy: line 26:
: not foundy: line 27:
./gorilla.py: line 32: All of the variables below in CAPS LETTERS are constants, that is, they are only supposed to be read and not
modified. (There's nothing to keep the program from modifying them, but it's just a convention programmers use.
The constants are a bit more descriptive than just using the numbers by themselves. And if you ever want to change
some value (such as the size of the explosions or the color of the gorillas), you only have to change it in one
: File name too long
: not foundy: line 33:
./gorilla.py: line 34: SCR_WIDTH: not found
./gorilla.py: line 35: SCR_HEIGHT: not found
./gorilla.py: line 36: FPS: not found
./gorilla.py: line 37: syntax error: "(" unexpected

I remember messing around with Gorillas when I was a kid in QBASIC - and Python is not very difficult, if I can just get it working!!!:mad:

StefanL 2011-02-15 18:37

Re: QBASIC Gorillas on N900 (Python)
 
I just navigate to the location of the gorilla.py file on my Nokia in x-term then type python gorilla.py and it loads fine. Still have the key assignment problems (same as Noobmonkey Post #5, ie. can't enter name of players) to test it but it loads :). Might mess with it a bit later.

NB: Got the file from an earlier post (Post #1) in this thread on a Windows machine and saved the web page to the N900.

Stefan

epage 2011-02-16 03:59

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by xxxxts (Post 947199)
Code:

./gorilla.py: line 19: Hello, and welcome to the source code of Gorillas.py. This program is meant to be very well documented so that a
novice programmer can follow along. This program was written by Al Sweigart as a companion for his free, Creative
Commons-licensed book Invent: File name too long
: not foundy: line 20:
./gorilla.py: line 21: import: not found
./gorilla.py: line 22: from: not found
./gorilla.py: line 25: We'll import quite a few modules for this game. pygame has all the graphics & game-related functions that the
Pygame game engine provides. sys has the exit() function. time has the sleep() function. random has the randint()
: File name too longontains the pi constant.
: not foundy: line 26:
: not foundy: line 27:
./gorilla.py: line 32: All of the variables below in CAPS LETTERS are constants, that is, they are only supposed to be read and not
modified. (There's nothing to keep the program from modifying them, but it's just a convention programmers use.
The constants are a bit more descriptive than just using the numbers by themselves. And if you ever want to change
some value (such as the size of the explosions or the color of the gorillas), you only have to change it in one
: File name too long
: not foundy: line 33:
./gorilla.py: line 34: SCR_WIDTH: not found
./gorilla.py: line 35: SCR_HEIGHT: not found
./gorilla.py: line 36: FPS: not found
./gorilla.py: line 37: syntax error: "(" unexpected

I remember messing around with Gorillas when I was a kid in QBASIC - and Python is not very difficult, if I can just get it working!!!:mad:

The shell can't figure out how to run it. The file is missing a line in it to run properly. You need to prefix the command with "python" to work around this.

xxxxts 2011-02-16 06:30

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by epage (Post 947680)
The shell can't figure out how to run it. The file is missing a line in it to run properly. You need to prefix the command with "python" to work around this.

I feel like such a dummy! Thanks!

StefanL 2011-02-17 09:40

Re: QBASIC Gorillas on N900 (Python)
 
Messed around with this a bit more now and can get into the game, but still having problems with user input (biggest problem is with entering numbers, I got the text input to work). I get all the way to the game screen, but only manage to blow up the monkey that is supposed to be throwing the banana. Anybody else managed to run the complete game?

StefanL 2011-02-17 12:06

Re: QBASIC Gorillas on N900 (Python)
 
5 Attachment(s)
Ok, managed to get the game fully functional now. It is running in full screen mode with full hardware acceleration. Had to do some hacking on the user input side to get it to work, but was minor and probably took this long, because I am not experienced in python. :D

Added my edited version of the file, made some small changes in main() and the user info screen subroutine. Sorry, have not really properly documented all the changes yet.

Added some screenshots for all you out there enjoying retro-land :).


All times are GMT. The time now is 10:54.

vBulletin® Version 3.8.8