You Are Here:

Community: Developer Discussion Boards

#1 Old [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-24, 22:02

Join Date: Mar 2003
Posts: 44
haviital
Offline
Registered User
Hi all,

I have made Creepy Invaders Python game for S60 3rd edition. You can download the sis packet and sources (under GNU license) from here:
http://koti.mbnet.fi/~haviital/index...ts_python_apps

I have coded it fully on device using E61i, E90 and Ped (First release was done with PyEditS60). Also graphics has been made on device, excluding background images.

There are several new features and improvements in v1.1.

Features:
- Background midi music
- Fast action & lot of moving objects
- Levels & scores
- Retro-style gfx made using ascii tables(!)
- Beautiful background images (new in v1.1)
- Adjusts to different device speeds (new in v1.1)
- An alien mothership that you can steal a shelter from :-) (new in v1.1)
- Volume can be adjusted by pressing <1>or <2> (new in v1.1)

Thanks for the Forum members for giving very useful hints and tools for development :-)

Br,
Hannu
Last edited by haviital : 2008-08-25 at 07:56. Reason: fixed the link
Reply With Quote

#2 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-24, 22:58

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Quote:
Originally Posted by haviital View Post
Hi all,

I have made Creepy Invaders Python game for S60 3rd edition. You can download the sis packet and sources (under GNU license) from here:
http://koti.mbnet.fi/haviital/index....ts_python_apps
Great !
But link is http://koti.mbnet.fi/haviital/index....ts_python_apps not the one you give us

Please correct the link

BR
Cyke64


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#3 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-25, 05:25

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
hi Hannu
great update the game seems quite interesting.
keep it up

Enjoy Pythoning
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#4 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-25, 10:27

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hi Hannu,

Good to see an update,

May be you could implement these in your next update
Quote:
Originally Posted by croozeus View Post
You could probably think to release a variant for accelerometer supported devices.
Quote:
Originally Posted by cyke64 View Post
Some suggestions for making better your little game :
- use accelerometer for N95 for moving the spaceship like Accelerinvaders game
Best Regards,
Croozeus
Reply With Quote

#5 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-26, 20:58

Join Date: Mar 2003
Posts: 44
haviital
Offline
Registered User
Hi,

I do not have accelometer in my phone so that explains my little interest in that. But it is very easy to spot the place where direction keys are read in default.py of Creepy Invaders sources. Anyone willing to test how accelemeter works for Creepy?
Reply With Quote

#6 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-27, 08:13

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Quote:
Originally Posted by haviital View Post
I do not have accelometer in my phone so that explains my little interest in that. But it is very easy to spot the place where direction keys are read in default.py of Creepy Invaders sources. Anyone willing to test how accelemeter works for Creepy?
Found an integration place in wizgamelibv6.py, which migth be better than default.py in case you're planning to reuse the lib?

Seems very easy task, I might give it a try at weekend. Sometime between swimming and circus

Cheers,

--jouni
Reply With Quote

#7 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-27, 17:21

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Help,

I have used ensymble just once in my life and everything went just fine. Now I get an error note:

Quote:
C:\_jom\python\_games\creepy_invaders\creepy_invaders>CreepyEnsymble.cmd

C:\_jom\python\_games\creepy_invaders\creepy_invaders>mypy2sis CreepyInvaders 0xA0003F37 1.1.0

C:\_jom\python\_games\creepy_invaders\creepy_invaders>c:\_jom\bin\ensymble.py py2sis --vendor="Hannu
Viitala" --caps=NetworkServices+LocalServices+ReadUserData+WriteUserData --appname=CreepyInvaders -
-uid=0xA0003F37 --version=1.1.0 --lang=EN --icon=CreepyInvaders.svg --shortcaption="CreepyInvaders"
--caption="CreepyInvaders" --textfile=CreepyInvaders.txt --heapsize=4k,4M --drive=c CreepyInvaders

Traceback (most recent call last):
File "c:\_jom\bin\ensymble.py", line 5, in <module>
if imp.get_magic()!='-\xed\r\n':raise RuntimeError,s
RuntimeError: requires python 2.2.2 or bytecode compatible
I have installed both python 2.2 and 2.5 - and python files are associated by default to 2.5. Any ideas how to force python 2.2 into use, just this once? I don't really want to reinstall 2.2 just to make this work... On the other hand I would like to see, if my changes were successful or not

Is there any other way to install Creepy Invaders except creating SIS? I copied all the source/graphics/audio files from folder CreepyInvaders into "root", but this is no way to do it...

Cheers,

--jouni
Reply With Quote

#8 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-27, 17:33

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Hmph,

What's the filename of your ensymble?

May be you should use ensymble_python2.5-0.27.py which is bytecode compatible with your Python 2.5?

Could you try that option ?

And I don't understand "Why you want to force Python 2.2 to use ?"


Best Regards,
Croozeus
Reply With Quote

#9 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-27, 18:28

Join Date: Mar 2003
Posts: 44
haviital
Offline
Registered User
Hi JOM!

Yes, I develop and test the game on device with Ped. You just have to:

1) put all libraries under libs, E:\python\lib
-wizgamelibv6.py
-wsd_creepy.py
-wspaceimages.py
-creepy_startscreen.py

2) put other files under e:\python
- default.py, *.jpg, *.mid

3) change variable in the beginning of default.py to:
- "debug_dev_env = 1"

That should be enough. You can see only one bg image in dev mode because of heap limitation of python shell.

Br,
Hannu
Reply With Quote

#10 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-28, 17:28

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Thanx for help, I got it running

Turn phone left or right, then whats-its-name goes that way.
Turn up or down, it shoots.

Not really tested, but doesn't crash any more. I'll email
you the sources to check and you can - maybe - integrate into
next version. Please note it really needs testing!

Btw thanx for the experience! If Creepy Invaders was my sw,
I'd rewritten keyboard handler. Now I couldn't touch it, so
had to figure out a nice & clean way to integrate - and found
a pretty nice way to do it

I'll have to update my Sensor Sample docs with this

Cheers,

--jouni having fun with sensors

Just in case, here's diff:

Quote:

Left file: C:\_jom\python\_games\creepy_invaders\creepy_invaders\CreepyInvaders\default.py
Right file: C:\_jom\python\_games\creepy_invaders\creepy_invaders_jom\CreepyInvaders\default.py
30a32,40
> SENSOR_ACC = False
> sensor_acc = None
> try:
> import sensor
> from sensor import orientation
> SENSOR = True # Sensor interface available
> except ImportError:
> SENSOR = False # Sensor interface not available
> s_active = 0
298a313,325
> def handle_sensor_orientation(a_data):
> ''' My own handler for accelerator events '''
> if a_data == orientation.RIGHT:
> e = {'scancode': EScancodeLeftArrow, 'modifiers': EModifierAutorepeatable, 'type': appuifw.EEventKeyDown, 'keycode': EKeyLeftArrow}
> keyboard.handle_event(e)
> elif a_data == orientation.LEFT:
> e = {'scancode': EScancodeRightArrow, 'modifiers': EModifierAutorepeatable, 'type': appuifw.EEventKeyDown, 'keycode': EKeyRightArrow}
> keyboard.handle_event(e)
> else:
> keyboard.__init__()
> if a_data == orientation.TOP or a_data == orientation.BOTTOM:
> e = {'scancode': EScancodeSelect, 'modifiers': EModifierAutorepeatable, 'type': appuifw.EEventKeyDown, 'keycode': EKeySelect}
> keyboard.handle_event(e)
309a340,342
> if SENSOR:
> # returns the dictionary of available sensors
> sensors = sensor.sensors()
309a344,350
> # Does this device have Accelerator Sensor
> if sensors.has_key('AccSensor'):
> SENSOR_ACC = True
> sensor_data = sensors['AccSensor']
> sensor_acc = sensor.Sensor(sensor_data['id'], sensor_data['category'])
> sensor_acc.set_event_filter(sensor.OrientationEventFilter())
> sensor_acc.connect(handle_sensor_orientation)
Reply With Quote

#11 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-28, 17:48

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Sorry,

Copy & Paste code. Even if it runs, doesn't mean it's ok
Please remove the red lines.

Of course I didn't run this modified version... Testing testing testing!

Cheers,

--jouni who found this while integrating Sensor API into another non-sensor application

Quote:
Left file: C:\_jom\python\_games\creepy_invaders\creepy_invaders\CreepyInvaders\default.py
Right file: C:\_jom\python\_games\creepy_invaders\creepy_invaders_jom\CreepyInvaders\default.py
30a32,40
> SENSOR_ACC = False
> sensor_acc = None
> try:
> import sensor
> from sensor import orientation
> SENSOR = True # Sensor interface available
> except ImportError:
> SENSOR = False # Sensor interface not available
> s_active = 0
298a313,325
> def handle_sensor_orientation(a_data):
> ''' My own handler for accelerator events '''
> if a_data == orientation.RIGHT:
> e = {'scancode': EScancodeLeftArrow, 'modifiers': EModifierAutorepeatable, 'type': appuifw.EEventKeyDown, 'keycode': EKeyLeftArrow}
> keyboard.handle_event(e)
> elif a_data == orientation.LEFT:
> e = {'scancode': EScancodeRightArrow, 'modifiers': EModifierAutorepeatable, 'type': appuifw.EEventKeyDown, 'keycode': EKeyRightArrow}
> keyboard.handle_event(e)
> else:
> keyboard.__init__()
> if a_data == orientation.TOP or a_data == orientation.BOTTOM:
> e = {'scancode': EScancodeSelect, 'modifiers': EModifierAutorepeatable, 'type': appuifw.EEventKeyDown, 'keycode': EKeySelect}
> keyboard.handle_event(e)
309a340,342
> if SENSOR:
> # returns the dictionary of available sensors
> sensors = sensor.sensors()
309a344,350
> # Does this device have Accelerator Sensor
> if sensors.has_key('AccSensor'):
> SENSOR_ACC = True
> sensor_data = sensors['AccSensor']
> sensor_acc = sensor.Sensor(sensor_data['id'], sensor_data['category'])
> sensor_acc.set_event_filter(sensor.OrientationEventFilter())
> sensor_acc.connect(handle_sensor_orientation)
Reply With Quote

#12 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-28, 21:37

Join Date: Mar 2003
Posts: 44
haviital
Offline
Registered User
That is great JOM! I will test that soon.
Reply With Quote

#13 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-29, 14:38

Join Date: Mar 2003
Posts: 44
haviital
Offline
Registered User
Hi,

I have tested "sensor-enabled" creepy version on N95. That is a nice hack :-)

I think it could be better if the x position of ship would be more "sensitive", i.e. so that you do not have to turn the phone so much to move. It could also accelerate more if the phone is turned more.

Or it could be using absolute position of the sensor, i.e. like raw mode in your sensor_sample application.

Br,
Hannu
Reply With Quote

#14 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-29, 21:47

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
Quote:
Originally Posted by haviital View Post
I have tested "sensor-enabled" creepy version on N95. That is a nice hack :-)
Great, same code works in two phones! PyS60 is great

Quote:
Originally Posted by haviital View Post
I think it could be better if the x position of ship would be more "sensitive", i.e. so that you do not have to turn the phone so much to move. It could also accelerate more if the phone is turned more.
Yep, that's the main (major) problem with OrientationFilter. It just isn't sensitive enough. I've been planning to check out how it was done and make my own more sensitive version - one of these days...

Btw please check, if there's a defect in your code: not sure, but it seems like the whats-its-name can run leftwards or rightwards for ever. I'd like to suggest that it should not be allowed to run out of screen, at least not too far?

With no limits in movements and more sensitive sensor detection, the "user" might easily slide a few meters off screen? Especially with additional acceleration! Integration is easy, calibration is hard.

Quote:
Originally Posted by haviital View Post
Or it could be using absolute position of the sensor, i.e. like raw mode in your sensor_sample application.
...I think this might be better solution. I have been thinking about absolute positioning often, but used only once. It's very basic way to use sensor (thinking) ...

Absolute position vs acceleration gives different user experience, not sure which one is more easy to understand. Absolute is easier to code, that's for sure. Absolute should also be easier/faster to learn in game play, no matter whether it's good or poor. Acceleration method would be more like in real life. Real life might be too hard?

Anyway, doing such is a bit more complex than redirecting OrientationFilter -> keyboard handler. I recall your code was pretty much tied into keyboard handler status info? Most likely would have to change that a bit == possible trouble.

Like I said, if Creepy Invaders was my game, I would have rewritten keyboard handling in different way

Cheers,

--jouni who might check the absolute positioning not this but next weekend if he still remembers
Reply With Quote

#15 Old Re: [announce] Updated Creepy Invaders game, v 1.1 - 2008-08-30, 07:57

Join Date: Mar 2003
Posts: 44
haviital
Offline
Registered User
Just go on and change keyboard handling if you like. That is no problem.

I think it should be relatively;-) easy to implement relative movement using "raw" events: Speed = (currValue - midValue)*factor.

But I would be tempted to see how absolute position works also. It is had to say which is better before trying first.

Yes, there is some bug in bounds checking. In E90 it works. Have to dig that out.

Br,
Hannu
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
[announce] Game "Tricky Mirrors" updated goetz_s Python 1 2008-08-19 07:52
[announce] Creepy Invaders game haviital Python 10 2008-04-12 22:24
Create Flashlite 1.1 platform game for "Nokia" narender_raul Flash Lite on Nokia Devices 1 2008-01-03 14:04
[announce] Manhattan Story Mashup py_s60 online game cyke64 News, Announcements and Job Listings 0 2006-09-19 07:08
有关mime type的问题,望大侠指教。 budan Web Technologies and Multimedia Content- Web 技术和多媒体内容 5 2006-01-30 12:44

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia