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)

xxxxts 2011-02-15 12:22

QBASIC Gorillas on N900 (Python)
 
I was looking for the .bas file for Gorillas to run in DOSBox on my N900, I stumbled upon this;

http://inventwithpython.com/blog/201...f-gorilla-bas/

I don't know Python too well, so I am hoping someone here could get this to run on the N900.

For those of you who don't know/remember Gorillas it was the Angry Birds of the early '90s! And it is still just as much fun!

I am REALLY hoping someone could get this up and running on the N900!:D

vi_ 2011-02-15 12:30

Re: QBASIC Gorillas on N900 (Python)
 
ahem, I'l just leave this here...

http://www.kongregate.com/games/Moly/gorillas-bas

epage 2011-02-15 12:48

Re: QBASIC Gorillas on N900 (Python)
 
I might see if I can get a chance to play with this. It might give me a bit more pygame experience to better deal with Omnom

xxxxts 2011-02-15 13:22

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by vi_ (Post 946963)
ahem, I'l just leave this here...

http://www.kongregate.com/games/Moly/gorillas-bas

Ha, yeah - I have seen it, but it is so much more... rewarding... to play it on the N900 in Python.

noobmonkey 2011-02-15 14:20

Re: QBASIC Gorillas on N900 (Python)
 
lol just ran it on my n900 - loads fine with no alterations - few issues with is recognising the n900 enter key, but that should be easy to fix, and chaning the screen size is easy, if i get time tonight i'll try and upload a basic n900 version port.

xxxxts 2011-02-15 15:04

Re: QBASIC Gorillas on N900 (Python)
 
I must be missing some py things...

noobmonkey 2011-02-15 15:25

Re: QBASIC Gorillas on N900 (Python)
 
all of pygame maybe?


import pygame, sys, time, random, math
from pygame.locals import *

epage 2011-02-15 15:40

Re: QBASIC Gorillas on N900 (Python)
 
Somethings that should probably be done before going to extras.
  • Windowing / close buttons
  • Configurable key bindings for international keyboards (will actually hit an assert and quit if you touch some of the unapproved keys)
  • Others?

Of course a pure touch interface would be cool but probably not worth it for now.

caco3 2011-02-15 15:41

Re: QBASIC Gorillas on N900 (Python)
 
LOL, good old times
With that game I started my first programming experience ;)

Why not run Win95 with QBASIC on the N900?
THAT would be nostalgic... :)

xxxxts 2011-02-15 15:57

Re: QBASIC Gorillas on N900 (Python)
 
Why am I missing those dependencies? I can't find what package to install... anyone?

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 :).

xxxxts 2011-02-17 15:59

Re: QBASIC Gorillas on N900 (Python)
 
1 Attachment(s)
I made an icon and a desktop file:

Make gorilla.desktop in /usr/share/applications/hildon and insert this;

Code:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=Gorillas
Exec=python /home/user/MyDocs/Games/gorilla.py (or where ever you put it)
Icon=gorilla
#X-Window-Icon=timerwidget
X-Window-Icon=gorilla
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable

Then place the attached icon in /usr/share/icons/hicolor/64x64/apps

vi_ 2011-02-17 16:03

Re: QBASIC Gorillas on N900 (Python)
 
For the love of god someone package this!

xxxxts 2011-02-17 16:12

Re: QBASIC Gorillas on N900 (Python)
 
Just a few observations/bug reports:

-A screen tap at "Press any key to continue" would be pretty nifty, as well as using a screen tap as the return key.

-Of course the N900 keyboard isn't mapped for this, and for some it is quite tricky (and annoying) having to hold down the alt key while pressing a number. Same goes for shift.

-If the buildings are moved closer to the bottom of the screen we will have more image of the sky and the bananas trajectory. It would also look better and be closer to the original.

-Some things aren't centered, not really a big deal.

StefanL 2011-02-17 16:24

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by xxxxts (Post 949011)
Just a few observations/bug reports:

-A screen tap at "Press any key to continue" would be pretty nifty, as well as using a screen tap as the return key.

-Of course the N900 keyboard isn't mapped for this, and for some it is quite tricky (and annoying) having to hold down the alt key while pressing a number. Same goes for shift.

-If the buildings are moved closer to the bottom of the screen we will have more image of the sky and the bananas trajectory. It would also look better and be closer to the original.

-Some things aren't centered, not really a big deal.

I haven't yet volunteered to be the keeper of the N900 version ;).

The screen tap is easy to implement, also moving the bottom of the buildings down is not a big deal, will do some more code hacking :).

Appreciate help on packaging, I am absolutely clueless!

arora.rohan 2011-02-17 16:30

Re: QBASIC Gorillas on N900 (Python)
 
Haha the game is so fun

to play it

put the gorilla.py in your mydocs folder
then in root
apt-get install python-pygame

after that
/home/user/MyDocs/python gorilla.py

and we have lift off ! :]

xxxxts 2011-02-17 17:12

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by arora.rohan (Post 949027)
Haha the game is so fun

to play it

put the gorilla.py in your mydocs folder
then in root
apt-get install python-pygame

after that
/home/user/MyDocs/python gorilla.py

and we have lift off ! :]

And if you want an icon on the desktop then just follow what I wrote previously.:D

xxxxts 2011-02-17 17:14

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by StefanL (Post 949024)
I haven't yet volunteered to be the keeper of the N900 version ;).

The screen tap is easy to implement, also moving the bottom of the buildings down is not a big deal, will do some more code hacking :).

Appreciate help on packaging, I am absolutely clueless!

Well I hope you stick around! It's great seeing Gorillas on the N900!:D

govprog 2011-02-17 17:57

Re: QBASIC Gorillas on N900 (Python)
 
I don't want to bother anyone, but why not KBasic?(Basic with Qt export function) you can copy the code there,export it,and compile it to debian using MADDE.(Full version of this program is available for free under linux platform.)

epage 2011-02-17 18:07

Re: QBASIC Gorillas on N900 (Python)
 
Sorry I've been too busy lately. Depending on my schedule maybe tonight or tomorrow I can try packaging it?

StefanL 2011-02-17 18:11

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by govprog (Post 949087)
I don't want to bother anyone, but why not KBasic?(Basic with Qt export function) you can copy the code there,export it,and compile it to debian using MADDE.(Full version of this program is available for free under linux platform.)

I like Python because it let's me do the programming and testing right there on my N900. :)

StefanL 2011-02-17 18:18

Re: QBASIC Gorillas on N900 (Python)
 
1 Attachment(s)
Done some more coding and lowered the bottom of the buildings and now you can just tap the first screen to get going.

This has been quite fun sofar and I appreciate all the help and encouragement. Will do some more coding tonight, but enjoy the latest version attached below.

NB: The zip also includes the desktop file and the icon from xxxxts post above. Make sure you edit the desktop file to point to the correct location of the saved gorilla.py file.

epage 2011-02-17 18:25

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by StefanL (Post 949099)
Done some more coding and lowered the bottom of the buildings and now you can just tap the first screen to get going.

This has been quite fun sofar and I appreciate all the help and encouragement. Will do some more coding tonight, but enjoy the latest version attached below.

NB: The zip also includes the desktop file and the icon from xxxxts post above. Make sure you edit the desktop file to point to the correct location of the saved gorilla.py file.

You familiar with using github? How do you feel about using it for coordination once I start packaging

StefanL 2011-02-17 18:32

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by epage (Post 949103)
You familiar with using github? How do you feel about using it for coordination once I start packaging

Sorry, I have not done any official coding before, so I am totally unfamiliar with any repository type applications etc.

Just a noob who likes to tinker with code and Python sofar is my favourite language for ease of use and being on my N900 :D

So go ahead and use whatever is best for you, I am not fussed about it in any way.

stevomanu 2011-02-17 18:42

Re: QBASIC Gorillas on N900 (Python)
 
wow this games brings back so many childhood memories

many thanks

casper27 2011-02-17 19:22

Re: QBASIC Gorillas on N900 (Python)
 
Anyone know how to play against the phone on this? it only seems to go straight into 2 player mode.
Koodos to all that brought this back to life.

xxxxts 2011-02-17 22:05

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by casper27 (Post 949138)
Anyone know how to play against the phone on this? it only seems to go straight into 2 player mode.
Koodos to all that brought this back to life.

DOSBox my friend... DOSBox... if I remember correctly there were 2 versions, maybe 3... - this is the original.

xxxxts 2011-02-17 22:07

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by govprog (Post 949087)
I don't want to bother anyone, but why not KBasic?(Basic with Qt export function) you can copy the code there,export it,and compile it to debian using MADDE.(Full version of this program is available for free under linux platform.)

Because it was already written in Python from the link I posted above and I am assuming it didn't require much modification to work perfectly on the N900. And keep in mind this is made in QBASIC, not BASIC - I don't know a lot about KBasic but it would be a lot more work I would think.

epage 2011-02-17 23:35

Re: QBASIC Gorillas on N900 (Python)
 
Quote:

Originally Posted by StefanL (Post 949099)
Done some more coding and lowered the bottom of the buildings and now you can just tap the first screen to get going.

This has been quite fun sofar and I appreciate all the help and encouragement. Will do some more coding tonight, but enjoy the latest version attached below.

NB: The zip also includes the desktop file and the icon from xxxxts post above. Make sure you edit the desktop file to point to the correct location of the saved gorilla.py file.

I've started work on packaging up this version. The repo for it can be found here:
https://github.com/epage/gorilla

If you don't feel like learning git, a simple way to coordinate is download src/gorilla.py, make changes, and email me the changed file with an approximate date/time you downloaded it. I can then more easily sync the changes back in and make a package.

epage 2011-02-18 03:32

Re: QBASIC Gorillas on N900 (Python)
 
It is now in extras-devel for Maemo 4.1 and Maemo 5. I have only tested it on Maemo 5 so far.

Thoughts on directions to go with this
  • Touch interface (task switcher, close, setting angle and velocity)
  • A QT Intro screen to make it easier to take advantage of on-screen keyboards for devices that need it.
  • Bug tracker (for getting into extras)
  • Check if battery usage while not focused is an issue and fix it. (for getting into extras)

caco3 2011-02-18 09:21

Re: QBASIC Gorillas on N900 (Python)
 
great work!

some issues:
its too fast, I only can see the detonation in the air but not the flight. this might be due overclocking to 850?

There is no sound.

It seems that the values have to be bigger than in the original game.


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

vBulletin® Version 3.8.8