headkase
Posts: 16
Joined: Sun Oct 23, 2011 4:20 am

Re: Pygame

Sun Oct 23, 2011 6:08 am

I know Python is going to be included so awesome. On top of that, the Raspberry Pi is intended to be an educational tool for kids so how about including Pygame? After all, there's nothing that grabs a proto-programmer like making games! ;)

Pygame depends on SDL so that would also have to be available.

Also, what version of Python is going to be included? I hope it would either Python 3.2.2. or that the included toolchain would allow you to compile that into the Pi from source. Pygame's source is also fully compatible with Python 3.2.2: I have it installed right now into my Windows Python 3.2.2 and also compiled it from source using gcc into a Linux 3.2.2 Python when I had a Linux box available to me. The only thing is that dependency for the Pi: SDL.

Pygame is one of the big - to me - things I hope the Raspberry Pi either supports out of the box or that I can compile in.

barnaby
Posts: 76
Joined: Fri Sep 16, 2011 6:32 pm
Contact: Website

Re: Pygame

Sun Oct 23, 2011 2:59 pm

After all, there's nothing that grabs a proto-programmer like making games!

It's funny, I started off making games in PowerPoint (yes, PowerPoint. I trust this will not be included on the raspi) and then game maker, but as soon as I started 'real programming' (mix of php, JavaScript, objective c and assembly) I lost all interest in making games.

I wonder if this is a pattern other people have been through?

Cheers,
Barnaby

Sciman
Posts: 19
Joined: Fri Jul 29, 2011 1:04 pm
Location: London
Contact: Website

Re: Pygame

Sun Oct 23, 2011 4:43 pm

I also would like to see Pygame pre-installed with Python 3 on the Raspberry Pi. At some point when learning to programme, students need to know about digging into libraries. This is an ideal one for many kids.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5197
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Pygame

Sun Oct 23, 2011 5:32 pm

Pygame's definitely something we'll be bundling. We're arguing about whether we prefer the Python 2 series (on the basis of how the Hello World program works, would you believe), but you'll definitely see one or the other on there.
Director of Communications, Raspberry Pi

headkase
Posts: 16
Joined: Sun Oct 23, 2011 4:20 am

Re: Pygame

Sun Oct 23, 2011 5:39 pm

Right on! Thank you liz!!!

Sciman
Posts: 19
Joined: Fri Jul 29, 2011 1:04 pm
Location: London
Contact: Website

Re: Pygame

Sun Oct 23, 2011 5:57 pm

That is great news. Python 3 pretty please. Kids always want the latest thing and do not want to put in time learning a language that they will see as already out of date.

My preference (I doubt you will be surprised) is the Python 3 Hello World program. It is great when coming to teach functions to be able to say that they are already using a function to which they have regularly been sending a series of arguments. This makes it much friendlier and more familiar to students at this stage in their learning.

headkase
Posts: 16
Joined: Sun Oct 23, 2011 4:20 am

Re: Pygame

Sun Oct 23, 2011 6:00 pm

I'm hoping for Python 3.2.2. The 3.x series is "going forward", 2.x is legacy. For "Hello World"?:

2.x: print "Hello World!"
vs.
3.x: print("Hello World!")

Just a statement vs. function. I would argue for 3.x because it cleans up "warts." The only reason for going with 2.x, as listed on Python's site even, is compatibility with older packages. The Pi does have the opportunity to start off with a new base-line: 3.x. I know quite a bit of system scripting in Linux in general depends on the 2.x series but that's all tucked away from end-user view.

If 2.x is chosen I hope with the toolchain I can install 3.2.2 and Pygame manually. (Just need those SDL-"dev" packages.. ;) )

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Pygame

Sun Oct 23, 2011 8:42 pm

As a far-away observer, 3.x does look much cleaner. I'd be concerned about libraries and available stuff, not by extra parentheses that make everything much more symmetrical and logical.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5197
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Pygame

Sun Oct 23, 2011 9:01 pm

Like I said - still arguing!
Director of Communications, Raspberry Pi

ajford
Posts: 15
Joined: Tue Sep 13, 2011 3:17 am

Re: Pygame

Wed Oct 26, 2011 9:19 pm

Even as 'Legacy', I vote Python 2.X, or even both. With VirtualEnv, you can run both side by side with out any troubles if needed.

In short, why not both?

spock
Posts: 204
Joined: Sun Oct 02, 2011 10:33 am

Re: Pygame

Tue Nov 15, 2011 6:27 pm

the differences are quite small. python 3 uses unicode strings by default. in python 2 using unicode is more cumbersome. isn't that kind of important for a project like raspberry pi?

the only disadvantage of python 3 i can think of is missing pyopengl. but then... i don't know if pyopengl would work with opengl es 2.0 anyway. probably not?

we urgently need a python opengl es 2.0 wrapper! :)

antiloquax
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
Contact: Website

Re: Pygame

Sat Nov 26, 2011 1:42 pm

I vote Python 3!

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: Pygame

Wed Nov 30, 2011 1:31 pm

just tried pygame on rpi (archlinuxarm OS)
PyBomb (minesweeper) works fine
# python2 -V
Python 2.7.2
# python3 -V
Python 3.2.2
python-pygame 1.9.1
Also tried bouncy ball tut, ball only moves when mouse is moved in window, don't know if that is usual?

gimliflea
Posts: 76
Joined: Fri Nov 18, 2011 4:14 pm

Re: Pygame

Wed Dec 07, 2011 6:08 pm

+1 for python 3

aho
Posts: 3
Joined: Sat Dec 10, 2011 3:26 pm

Re: Pygame

Sat Dec 10, 2011 3:42 pm

I also prefer the 3.x Hello World. While it looks more complicated, it doesn't introduce a special case. "print" is just a function like any other function. That's the way it should be.

johnny66
Posts: 3
Joined: Tue Nov 01, 2011 12:23 pm

Re: Pygame

Thu Jan 05, 2012 3:47 am

Has any looked at Love (LÖVE)? A fantastic Lua based platform for writing 2D games.

I use it to develop stuff for Sony PS3 'Home'.

It takes me seconds to run code under Love2D (runs on Mac/Linux/PC (i386, OpenGL)) - compared to minutes to get it running on my Sony Dev kit.

nichobb
Posts: 82
Joined: Sat Nov 19, 2011 10:34 am

Re: Pygame

Sat Jan 07, 2012 5:00 pm

@liz
Pygame"s definitely something we"ll be bundling. We"re arguing about whether we prefer the Python 2 series (on the basis of how the Hello World program works, would you believe), but you"ll definitely see one or the other on there.



Can I ask which side you are one? Only so we know which one will win

iDaemon
Posts: 8
Joined: Sat Jan 14, 2012 12:10 pm

Re: Pygame

Sun Jan 22, 2012 7:42 pm

Just had to share with the forum:

- I just created my first (admittedly very simple) programme in Python !!!

15mins to create, 30 to debug, but I learned tons. Even my kids thought it was a bit cool and they're pretty hard to impress. Variation on Hello World, but generated and printed a random number 0-100 that was a mock 'coolness percentage of the user'. (Yeah, I know, I know.)

Took me back to being nine years old trying to programme my Commodore64, except this time, I got it!

== THANK YOU FOR THE PI PROJECT ==

Simon, Norfolk, UK (aged 10 & 120/4)

PS/ Python 3 as standard please.

cattail
Posts: 6
Joined: Mon Mar 05, 2012 2:18 am

Re: Pygame

Mon Mar 05, 2012 7:09 am

I knew love2d (from 0.5.0) , it's small footprint , easy to use, and use SDL lua for script.

Use it fot makeing game is easy, almost out 0.8.0 support UTF-8 , and a lot of libs make thing faster (like add joystick etc) .

If someone write some foo.love for edu , child can modify the  game characters behavier

easily and a lot of fun , and find lua is useful .

Neon22
Posts: 29
Joined: Mon Sep 19, 2011 4:11 am

Re: Pygame

Mon Mar 05, 2012 11:26 am

I agree python 3.x is cleaner and removes the idiosyncracies of python 2.x.

However many libs are not yet available for 3.x.

E.g. openni for connecting the Kinect sensor, and opencv packages.

The similarities for 2.7 are very close to 3.0 (that is the point of 2.7)17

I'd vote 2.7 if I had to choose - but I'd prefer both.

As my wife would say - You can have your cake and eat it too - if you have two cakes.

Cheers...

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Pygame

Mon Mar 05, 2012 12:09 pm

There's an interesting paper on using Python 3 for teaching here.

I'd vote for Python 3 on the Educational release, which will give everyone a few more months to port libraries.

What's new in Python 2.7 says


Python 2.7 is intended to be the last major release in the 2.x series. The Python maintainers are planning to focus their future efforts on the Python 3.x series.

This means that 2.7 will remain in place for a long time, running production systems that have not been ported to Python 3.x. Two consequences of the long-term significance of 2.7 are:



It’s very likely the 2.7 release will have a longer period of maintenance compared to earlier 2.x versions. Python 2.7 will continue to be maintained while the transition to 3.x continues, and the developers are planning to support Python 2.7 with bug-fix releases beyond the typical two years.


...


So while it is probably safe to use Python 2, no further enhancements are likely. As a consequence I would not prescribe Python 2 for use in the 2012/2013 academic year.

In the meantime, I have no clear opinion, but if you include the line:from __future__ import absolute_import, division, generators, unicode_literals, print_function, nested_scopes, with_statement
Then you can write the same code in Python 2 as in Python 3. I'm not sure how far that goes, but if you test in each, you should be fine.

dextrus
Posts: 119
Joined: Tue Jan 24, 2012 10:10 pm
Location: Eastleigh, Hampshire
Contact: Website

Re: Pygame

Mon Mar 05, 2012 10:49 pm

For me, Pygame is a no-brainer, It's a must-have. But this does bring problems for the an educator. Why?

Boilerplate code. In order to do anything meaningful with Pygame you need quite a bit of "stuff", and this can be, I can probably go as far as *is* off-putting to students. 10 year-old's don't need to know about imports, loops or events at first. I just want them to make space-ships (or Ninja's, or Pirate's) and so do they.

Meaningful is important these days. Promising that they can calculate the average age of the class, even with pie-charts, isn't going to cut it. Their language is games.

This led me on a quest for a suitable Python friendly IDE where I could not only have videos and commentary, but conditionally hide code. What I'd like to do is this:



I couldn't find one. However, I did find Crunchy (and this was from my posts to the Geany forum) http://code.google.com/p/crunchy/ and I'm talking to the author about making modifications that might better fit the Pi model (well ok, my model). Do check Crunchy out and consider teaching game development as a way of teaching other stuff by stealth. I am not advocating and I abhor "serious games", whereby you make a game for students to play that "teaches" them stuff. No.. Get them to make the game then they'll learn the maths, the group-collaboration, the ICT, the script-writing, the music..etc.
Have more FUN with your Pi. Visit www.pi-fun.com

dextrus
Posts: 119
Joined: Tue Jan 24, 2012 10:10 pm
Location: Eastleigh, Hampshire
Contact: Website

Re: Pygame

Mon Mar 05, 2012 10:49 pm

For me, Pygame is a no-brainer, It's a must-have. But this does bring problems for the an educator. Why?

Boilerplate code. In order to do anything meaningful with Pygame you need quite a bit of "stuff", and this can be, I can probably go as far as *is* off-putting to students. 10 year-old's don't need to know about imports, loops or events at first. I just want them to make space-ships (or Ninja's, or Pirate's) and so do they.

Meaningful is important these days. Promising that they can calculate the average age of the class, even with pie-charts, isn't going to cut it. Their language is games.

This led me on a quest for a suitable Python friendly IDE where I could not only have videos and commentary, but conditionally hide code. What I'd like to do is this:



I couldn't find one. However, I did find Crunchy (and this was from my posts to the Geany forum) http://code.google.com/p/crunchy/ and I'm talking to the author about making modifications that might better fit the Pi model (well ok, my model). Do check Crunchy out and consider teaching game development as a way of teaching other stuff by stealth. I am not advocating and I abhor "serious games", whereby you make a game for students to play that "teaches" them stuff. No.. Get them to make the game then they'll learn the maths, the group-collaboration, the ICT, the script-writing, the music..etc.
Have more FUN with your Pi. Visit www.pi-fun.com

barr5790
Posts: 7
Joined: Thu Oct 13, 2011 7:03 pm

Re: Pygame

Sun Mar 18, 2012 1:31 pm

I would hope whichever version you choose as the recommended/standard version of Python you stick with it. I would prefer to see 3.X being picked as it is the as it is the "future" of the language (be it uptake is a little slow).

I wouldn't like to see a lot of resources being made focused on 2.7 and in a year or two's time a switch to Python 3 (because of its increasing popularity) leading to confusion in schools about why code which worked last year suddenly has errors this year (even if the fix is simply changing a few print's).

Of course choosing 2.7 and sticking with it should cause no problems.

antiloquax
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
Contact: Website

Re: Pygame

Tue Mar 20, 2012 7:04 am

Bear in mind that Pygame doesn't work with 3.2.2. I think 3.1.4 is the most recent version that is supported.

Switching from 2.x to 3.x is not difficult for the computer - just run:

2to3 filename.py -w

Return to “Staffroom, classroom and projects”