Archive for September, 2012

Next Tutorial…Python Tutorial 03: Creating Assets

The next Python tutorial will cover creating assets as a continuation of the previous examples. It will show methods of creating the player’s spaceship using Paint.net and Inkscape using two different drawing styles to compare, and then code will be introduced to show the player’s spaceship and how to control it (using the arrow keys) in the game window. Following in the format of the tutorials the code will work equally well with either Python 2.x or Python 3.x.

Advertisements

, , , ,

Leave a comment

Python Tutorial 02: Adding a background

In the first tutorial, we created a simple window using Python and Pygame. The next step, will be building on that example, we will create a star field background, then write the code to animate it.  One important point about these tutorials is the assumption that anyone following along already has at least a basic knowledge of how Python code is structured.  If that is not the case, then you should, at the very least, want to have the Python documentation(included in the Python install) at hand incase you wanted it for a reference.  There are some very good resources available for Python, either through THE OFFICIAL PYTHON WEB-SITE or by completing a Google search on the Python version you have installed.  If you have already coded the first tutorial you should do just fine with this one.  If there are any comments about the tutorials, whether they are critical or complimentary, you’re welcome to post them.  If there’s information that I have glossed over or skipped entirely, let me know, and I will add it in, with future edits of the tutorials.

starfield

NOTE:

I typically use Editra v0.7.12 to write Python code, when including the psyco try/except block, Editra would occasionally crash.  When I ran the starfield.py file in Python IDLE 2.6, it never crashed(but you need to have the pygame.quit() statement, so the app window does not crash).  If you’re using a different IDE your mileage may vary, if in doubt, use IDLE as your benchmark(or use IDLE to run this example).

UPDATE: Psyco is no longer supported as of March 12, 2012. If you are already using it you can choose to include it, if you’re not using psyco then avoid the install unless your confident that you can make it work.

Skip the source code in red, it is the psyco try/except block!

Read the rest of this entry »

, , , , ,

1 Comment

In the works…Python Tutorial 02: Adding the Background

In the first tutorial, we created a simple window using Python and Pygame. The next step, will be building on the previous example, to create a star field background, then write the code to animate it.

starfield background

star field background with animation

, , ,

Leave a comment

Chicago’s Summer of Arcade – IGDA Chicago (Chicago, IL) – Meetup

On Wednesday, September 26,2012 @ 7pm

Location :

Starter League

222 Merchandise Mart Plaza,

(12th floor   room: 1871)

Chicago, IL

Dave Lang, CEO of Iron Galaxy(Wreckateer), and Josh Tsui, President and co-founder of Robomodo (Tony Hawk’s Pro Skater HD) will be discussing their experiences and observations of creating downloadable products for the XBLA promotion called XBOX Live Summer of Arcade.

This will be a paid event.

Buy tickets before 9/17 at $10; all tickets afterward at $15.  IGDA members receive an admission discount.

The original meetup posting can be found at:

Chicago’s Summer of Arcade – IGDAChicago (Chicago, IL) – Meetup.

Sponsor of the event

,

Leave a comment

Python Tutorial 01: A Basic window using Python and Pygame.

The best way to get the most updated version of Python is from the Official Python Web-site, and Pygame found at the Pygame Official Web-site.  The most popular question when starting with Python, “Should I start with 2.x or 3.x?”.  The answer I would suggest, if you’re not supporting legacy code (versions like 2.5 or older) start with the newest version of Python you can run on your system, and handle your coding requirements.  As an example, for my situation, I have multiple versions installed ( 2.4 for Nvidia’s Fx Composer 2.5, 2.6 for Blender 2.49 and Panda 1.7, and 3.1 for coding and Blender 2.5/2.6 ), it’s what works for me.  Others might decide to have a particular version of Python on their hard drive, and other versions on memory sticks.  Just a reminder, the Python install is typically small ( less than 30 MB, so many applications written in Python include the Python code for simplicity – Blender and FX Composer both run this way), so if you have Open Source software on your system, or are running a non-Microsoft OS your system probably already has some version of Python.

The included code is in Python (it works with both 2.x and 3.x) and uses the Pygame version 1.9 library.

Read the rest of this entry »

, ,

1 Comment

A very informative article: The Guide to Implementing 2D Platformers

Blog: Higher-Order Fun

address for the article : http://higherorderfun.com/blog/2012/05/20/the-guide-to-implementing-2d-platformers/

Author: Rodrigo Monteiro

Subject: An explanation of 2D platformers.

Rodrigo’s point of view for this article is from reverse-engineering the game behavior of  4 implementations of 2D platformers.  His explanations are in-depth with ample information and examples to illustrate his perspective.  My only question is, why isn’t this article on Gamasutra.com?

, , , ,

Leave a comment

Taking Blender 2.63a for a test drive …..sweet!

I know what most Blender-heads would say, version 2.63 has been out for a while.  I have been comfortable with the workflow of 2.49, got it tweaked in a way that’s familiar, and what happens ?  The folks at Blender.org decide to put their efforts into overdrive with version 2.5x and then 2.6x.  I had a copy of 2.57 a played with it on and off, but now its version  2.63, (this time next year it might be up to 2.89). I figure I would give the latest version a shot (thankfully they[the Blender Illuminati] have a solid foundation in place where older blender files work well(with minimal effort) on newer versions).  So I gave it a try, to do a character from scratch … the verdict…extremely polished.  From the features, UI, and extremely flexible setup, 2.63 looks and feels like “top shelf” pro-grade software.  And in a matter of  a couple of hours, I had one more reason to make my nephew laugh.

, , ,

2 Comments

A simple source code template that works with MS Visual Studio, MinGW, QT Creator, and NetBeans

I was recently asked by someone starting to learn C++,

“How do you stop the window from disappearing when the when your program ends?”

I know that there’s more than one way to solve this problem, but this is the template I use, I hope it  helps….

/*
    File     :  program_name.cpp
    Author   :  Author Information    
    Date     :  File Creation date    
    Rev Date :  Revision date    
    Platform :  Hardware/Software the code was written and tested on.
    Purpose  :  Short description of what the code from this file does.     
*/
/*
    Header file listing (tells the compiler what support code will be needed)
    Standard headers first < stdio/iomanip/iostream > 
        - some may not need the -.h extension
    Library or SDK headers next < OpenGL/DirectX/SDL/FMOD>
    Custom files next "generic_template.h"  (use quotes NOT brackets)   */ 

//NOTE: MinGW & Microsoft compilers list C++ core header files - .h
#include <iostream>	
// used to call functions to delay window termination
#include <limits>     	

// Replaces std::cout with cout, A namespace is required 
using namespace std; 	

//- Globals (sparingly!)
//- Function Prototypes 

// Listing main with out stating a type is an ISO error
int main() 		
{
/* 	Define and initialize variables at the earliest point in your code
    in for loops (always initialize the counter with its type)
    
        for ( int i = 0; i <= condition; i++ )
    
       Your code should be well documented,  all comments are 
    skipped over by the compiler, the more readable it is the easier 
    to understand the process used.
        
       In some compilers, if the code between this point and the 
    final return statement is left out, during a console window session,
    the window will disappear IMEDIATELY, once the last character 
    is printed.  If info was sent to the console window, to receive user 
    input, and the last thing that was logged was the user pressing 
    the ENTER key, the window will still close rather quickly, in that 
    case add the cin.ignore line a second time, and the console window
    is forced to remain until the user intentionally 
    presses the ENTER key a second time.                                     
*/
    
    //Add this if the console window keeps vanishing
    cout << "\n\nPress ENTER KEY to continue...\n\n";
    
    // Waits for the user to respond, then exits
    cin.ignore(numeric_limits<streamsize>::max(), '\n');         
    
    //Indicates that the program ended successfully
    return 0;
}

, , , , , , ,

Leave a comment

%d bloggers like this: