WICS - Flappy Anteater Python Tutorial

Slides:



Advertisements
Similar presentations
Clicking on the link for the.tns file gives you will get the following screen: Select Save File and click OK.
Advertisements

Graphics Shapes. Setup for using graphics You have to import the graphics library You can use either “import graphics” or “from graphics import *” or.
Python Programming, 2/e1 CS177: Programming in Multimedia Objects Recitation Topic: Graphics Library.
2 What is pyGame? A set of Python modules to make it easier to write games. –home page: –documentation:
Start the slide show by clicking on the "Slide Show" option in the above menu and choose "View Show”. or – hit the F5 Key.
Start the slide show by clicking on the "Slide Show" option in the above menu and choose "View Show”. or – hit the F5 Key.
Learn about the types of Graphics that are available Develop a basic Graphics applet Develop a basic Graphics application Review the Java API and use.
4th Grade Math Multiplying 2-digit by 2-digit Numbers Using the Area Model / Box Method.
Make a blank window This is a starter activity and should take 5 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.In script mode create a file.
Blackboard Directions Required Proficiencies. Search ‘blackboard’ in the upper right hand corner.
CHAPTER 3 (P.49-53) Importing modules + pygame intro.
What is Voice Thread? VoiceThread is an application that runs inside your web browser, so there is no software to download, install, or update. VoiceThread.
Windows Installation Tutorial NASA ARSET For Python help, contact: Justin Roberts-Pierel
1. Starting 1 Let’s Learn Saenthong School, January – February 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
PyGame - Unit 1 PyGame Unit – – Introduction to PyGame.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 22 Game Graphics.
Turtle Graphics Let’s see what we can draw on Python!
Windows Installation Tutorial NASA ARSET For Python help, contact: Justin Roberts-Pierel
Intro to Pygame Lecture 05. What is Pygame? It is a set of Python modules designed for writing games. It makes writing games possible for beginners. import.
Online Recruiting System Hiring Manager Presentation This presentation will take about 15 minutes. Click on your mouse to go to the next slide OR click.
3. Drawing Let’s Learn Saengthong School, June – August 2016 Teacher: Aj. Andrew Davison, CoE, PSU Hat Yai Campus
Reference: What is it? A multimedia python library – Window Management – Graphics geometric shapes bitmaps (sprites) – Input Mouse Keyboard.
Publisher CREATING A NEWSLETTER. Finished Product.
ACAP Online Application Process
Sprites (Images) and Sounds
Python Data Analytics & Visualization
MOM! Phineas and Ferb are … Aims:
Pixels, Colors and Shapes
A look ahead: At the end of your project, you’ll be given an opportunity to make a standalone (.exe) version of your project. For this to work, you’ll.
Introduction to Python
Catapult 2016.
After logging in go to “Lodge Reports”
PYGAME.
WITH PYGAME ON THE RASPBERRY PI
Let’s Learn 2. Installing Pygame
8. Installing Pygame
PubMed Database Interface (Basic Course Module 4 Part B)
The Smarter Balanced Assessment Consortium
Using PowerPoint to Scaffold a Text
9. Drawing.
9. Drawing Let's Learn Python and Pygame
T_C_N_L_G_ E D I D I E O Y O H I E B J I R E A A W.
The Smarter Balanced Assessment Consortium
Bomgar Remote support software
Videos For All Classrooms
Student Registration/ Personal Needs Profile
Update Requirement Package
1 2 3 Here we are on the Ohio Web Library’s home page. To get to Business Source Premier, use the following steps: 1. Go to Ohio Web Library 2. Click on.
Viewing Oracle Attachments
Let's Learn Python and Pygame
My Country.
The Smarter Balanced Assessment Consortium
STARS Training – How to Give District Tests
Learning PowerPoint Just the basics.
8. Starting Pygame Let's Learn Python and Pygame
The Smarter Balanced Assessment Consortium
ALL DEVICES EXCEPT CHROMEBOOKS:
BSc in Digital Media, PSUIC
Prof. Abdul Hameed Windows 10 Module 2 Prof. Abdul Hameed
Go to the Audacity website. (You can search for Audacity in Google).
Find the AR Level of Your Library Book!
How the external websites relate to the BIPAI Pharmacy CPD
Introduction to RefWorks
Windows Installation Tutorial
The Smarter Balanced Assessment Consortium
Find the AR Level of Your Library Book!
Student Registration/ Personal Needs Profile
Beginning Sounds! Match It! Click here to play..
The Smarter Balanced Assessment Consortium
Presentation transcript:

WICS - Flappy Anteater Python Tutorial Session 1 April 21st 2014

Announcements 5 weeks (Week 4 – Week 8) Participants will receive swag at the end Tutorials are aimed at beginners Those with experience may start the project

Join the Facebook Group https://www.facebook.com/gr oups/725853740799872/ We’ll post the slides on this page Any other updates will also be posted here

Groups You may work in a group or individually At the beginning of the 3rd session (after the tutorials), we’ll record the names of all the participants Participants that turn in the project will enter the raffle

Let’s start! 

Importing Pygame In order to create Flappy Anteater, you have to import pygame, which is a set of modules that are used for creating games. It provides computer graphics and sound libraries that are designed to be used with Python.   Before you import pygame, you have to download pygame from pygame.org (To know which version of Python is installed in your computer, open an IDLE window.) Here’s the link: http://tinyurl.com/pygamedownloads import pygame will import all the available modules into the pygame package

Importing Modules A module is a file that contains Python definitions and statements. It consists of functions, classes, and/or variables. For example, the built in module called math contains math operations that can be used by importing the module onto your own module. If you wanted to calculate the square root of a number, you would have to call the square root function from the math module. import math math.sqrt(enter_number_here)  

Initializing pygame Before using pygame, you have to initialize it. You can find the function by looking at the pygame documentation -> pygame. pygame.init() will initialize all imported pygame modules

Changing window title You can change the window title by looking at the pygame documentation -> display. There’s a function that will allow you to set the window caption. pygame.display.set_caption(“enter_string_her e”) sets the current window caption

Screen coordinates (0, 0 at top left corner instead of bottom left) In Pygame, the coordinate system is slightly different than the one that we’re used to seeing in math. The origin point (0, 0) is on the top-left corner, and the x-coordinates increase as you move to the right and the y- coordinates increase as you move down.

If you had an area that was 300 pixels wide and 400 pixels tall, then the coordinate system would look like this:

Creating a screen (size) You can change the size of the window by looking at the pygame documentation -> display. There’s a function that will allow you to create a screen. pygame.display.set_mode(enter_width, enter_height) will initialize a window or screen for display

Quitting pygame Calling the quit() function will ensure that all initialized modules are uninitialized when Python finishes. You can find the function by looking at the pygame documentation -> pygame. pygame.quit() uninitializes all pygame modules

Using pygame documentation Like in the Python documentation, you can search up the various functions and how to use them in pygame by looking at the documentation. Link: http://www.pygame.org/docs/