Python Games – Week 10: Ping Pong game

As we have covered most of the concepts required to make games using Pygame I won’t be doing any more slideshows instead we will spend all of our time writing games from now on. Today we started to make a very simple Ping Pong game and we will spend another session or two finishing it.

tennis

Anybody who has missed a few sessions is always welcome back, but now would be a great time to return as we will be explaining everything from the beginning again.

Python Games – Weeks 8: Adding audio and health bars

Apologies for the delay in posting the notes from yesterday. In the Python Games group we finally finished our Ocean Cleaner game which we are looking forward to demonstrating to everybody next Saturday.

ocean_game

In order to finish our game we had to learn about adding audio and health bars. The demo code we used is available on Dropbox here and our completed Ocean Cleaner game is available here. Here are my slides python session_8

Python Games – Weeks 5-6: Getting started with Pygame

Last week we relocated to NUIG for a Massive Open Dojo Session. There was lots going on to enjoy and it was great to see such a large turn out. Well done to our own Michael Madden and to Karl Sweeney from CoderDojo Galway City for organizing it all. Thanks also to Martha for the t-shirts.

The ninjas from the Python Games group who attended didn’t do any new coding but they enjoyed personalizing the Bunnies And Badgers game with their own images. We were set a challenge to create a game to highlight the environmental issues facing the oceans. We started working on that today and we will continue with that for a few weeks. Ocean Cleaner

Before we started working on that today we had a look at some basic Python concepts contained in this demo program. Next week we will look at using lists and for loops in Pygame and at collision detection.

Here are my slides from today python session_6

Python/Pygame- Awarding Belts

belts

 

Sorry for not posting for a while but as the group have been working on their own games for the past few weeks we haven’t looked at any new concepts.

This weekend we discussed awarding Belts. There are three belts available white, yellow and blue.

White belts are for ninjas who have attended at least five sessions and know how to get started with Idle.

Yellow belts are for ninjas who can demonstrate a basic understanding of coding with Python.

Blue belts will be awarded to ninjas who are more skilled coders.

Anybody who has attended more than five python sessions is entitled to apply for a belt so don’t worry if you haven’t attended for a while you can still get a belt.

Here are my slides from this week Belts.

 

 

 

Python Beginners – Driving Game

trackCap

This week we looked at code for the bare bones of a race car game.
We started off by just moving a block around the screen and then rotating it. Then we figured out how to drive it around the screen.
Finally, we looked at how to give the impression of movement to our car sprite by scrolling the track around behind it.
For next week I want the Python group to look at Scratch Beginners week 2 and week 3 as we are going to attempt the same thing in Pygame.
You can find our code from this week here.

Python Beginners – Space Defender

                                       ImageToday in the Python group we looked at how a few simple changes can change the look and feel of a game. Our space Defender game uses code recycled from last weeks Bunnies And Badgers game combined with a few new sprites to make a completely new game. We also looked at how to use Geometry when moving sprites around the screen.

movex=math.cos(angle_z)*10
movey=math.sin(angle_z)*10
xpos+=movex
ypos-=movey

The above code calculates how many pixels the x and y coordinates of our sprite needs to be changed for it to move 10 pixels in the direction of angle_z. You can learn more about Sin and Cos here.