What About Packman?

Who would like to learn Python with us and rewrite Pacman in the process?

Martin Bryant
Martin Bryant
500
| 4 1 2
Asked on 1/29/15, 1:27 PM
1
vote
358 Views

This should make a good first project. From group projects that I've worked on before, a good strategy is to decide on the classes that the program will be made of, and how they will interface with one another. This means that people can be responsible for individual classes, which gives everyone a direction and also reduces the risk of people breaking each others' code. It is also important to keep classes compartmentalised - for example, the properties 'position' and 'is_alive' of a given ghost would be stored within an instance of the 'Ghost' class, and only the Ghost itself would ever change those values (although it might present an interface with which it could be controlled - for example 'move(direction) or die()').

If we take this approach, it will be important that everyone has a basic understanding of 'object-orientated' (class-based) programming; essentially this is a way of organising code so that rather than writing programs purely in terms of 'steps', you instead write then in terms of 'things' which can interact with one another (like 'Ghost' or 'World', or more abstract concepts such as 'RoutePlotter', 'GUIManager'). These classes can also extend ('inherit') others, so it might be a good idea to define an 'Entity' class (with properties like 'position' and 'speed'), and then to define 'Ghost' and 'Pacman' which inherit from Entity (and as such, automatically acquire the 'position' and 'speed' properties without having to do anything else!). Any decent Python tutorial will at some point explain all these concepts and how to implement them (I'm also more than happy to answer questions or give demos at the club). If you understand the aforementioned terms 'class', 'instance', 'interface', 'inherit' and 'property' (and how to implement them in Python) then you're well on track!

Tom Pickering
Tom Pickering
30
| 2 0 0
Answered on 2/7/15, 6:37 PM
0
vote

Pacman sounds like fun to create!

Hopefully quite a few areas for multiple people to work on as well:

1) AI

2) GUI

3) Behaviours.

4) Human  Interaction.

raspberry_pi_rules
raspberry_pi_rules
5
| 1 0 0
Answered on 2/4/15, 8:45 PM
0
vote

I'd settle for getting pygame installed on Python3 for the moment.

Martin Bryant
on 2/5/15, 10:10 PM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/29/15, 1:27 PM
Seen: 358 times
Last updated: 2/7/15, 6:37 PM