Posts Tagged programming

Scott Hanselman’s 2014 Ultimate Developer and Power Users Tool List for Windows – Scott Hanselman

A great list of resources for Windows users!!!!!

Scott Hanselman’s 2014 Ultimate Developer and Power Users Tool List for Windows – Scott Hanselman.

, , , , , ,

Leave a comment

40+ Fantastic Game Development Tutorials From Across the Web | Gamedevtuts+

Michael James Williams wrote an article on 12/20/2012 …

In which he presents a list of 40+ game development tutorials he feels are of interest( and so should you 😉 ).  The list covers everything from coding and math to aesthetics and game design.  If you haven’t already seen it or come across the mentioned sources, definitely check it out.

40+ Fantastic Game Development Tutorials From Across the Web | Gamedevtuts+.

, , ,


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.



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 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

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 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

Editra – Add the plugins and it’s a very flexible IDE (with syntax highlighting for Python)

You can find Editra at

The current version is 7.12 and it requires wxPython 2.8 to run. On my system, Editra is setup with Python 2.6 but I can run any version of Python through it (2.4, 2.6, 3.1, and even Panda 3d-Python 2.6). Where Editra really excels is by adding the optional plug-ins. Once installed, these transform Editra into a serious IDE for Python projects or simple code dissections.

Available for Linux, Mac OS X, and Windows

The project documentation explains everything from installation and configuration to adding the plugins, and by checking you will see a list of other languages that Editra can be used to edit.

If your looking for a streamlined, functional, and flexible Python IDE, Editra is definitely worth a look.

, , , , , , ,


Python 3: Native Data Types: Cheat Sheet

When first learning Python 3, I made a “cheat sheet” listing of the data types, primarily to help get myself accustomed to Python’s data types that differed from the data types used in C++. I did this while reading Mark Pilgrim’s book “Diving into Python 3″(Highly recommended as a solid intro into Python 3) and using the Python v3.1.3 documentation. I decided to post the “cheat sheet” just incase someone finds it useful. This is by no means the definitive listing for Python data types, but it is intended as a quick reference for basic features of the types listed.

Python 3.1: Native Data Types

  1. Booleans
    1. True = 1
    2. False = 0
  2. Numbers
    1. Integers                                                               2,3,4, etc.
    2. Floating Point                                                     2.0, 3.0, 4.0, etc.
    3. Fractions  (import the fractions module)      2/3, 3/5, etc
    4. Complex                                                             (real)i + (imaginary)j
    5. In a Boolean Context
      •             zero values are False
      •             non-zero values are True
  3. Strings
    1. Sequences of Unicode characters
    2. Delimited by either single or double quotes – use double quotes when an apostrophe is present in the string
    3. Do not take arithmetic operations (without a conversion – obviously!)
  4. Bytes and Byte Arrays
    1. Have all methods found on strings, with the exception of encode(), format() and isidentifiier()
    2. Bytes objects are immutable , 8-bit bytes, in the range of 0 to 256
    3. Byte array objects are mutable and unhashable.
    4. Image files
  5. Lists
    1. Indexed a_list[0] (index from left to right) a_list[-1](index from right to left)
    2. Slices a_list[x:y]
      •              x = start point included
      •              y = end point, up to but not included
      •              [:] = copy the entire list
    3. Adding items
            •              append(x)
            •              extend([x,y,z])
            •              insert(x, value)
            •                        x = position to inset value
            •                       value = the object to insert at position x
    4. Duplicates are allowed
    5. Holds anything and its dynamic
    6. del a_list[1]   => deletes a specific item
    7. del a_list       => deletes the entire list
    8. a_list.pop(x)
      •             when x is omitted, removes the last item in the list and sends it as output
      •             when x is provided, removes the item at position x and sends it as output
    9. Calling pop() on an empty list raises an exception!
    10. In a Boolean Context
        •             an empty list is false
        •             a non-empty list is true
  6. Tuples
    1. Accessed just like Lists
    2. There is no mechanism to change a Tuple (add/subtract elements)Equivalent to a “write-protected” list
    3. A tuple can be sliced like a list
    4. Check for specific values
    5. Can assign multiple values at once (in order)
    6. If the tuple has a single element, it must be followed by a comma – to consider it a tuple
    7. In a Boolean Context
      •              an empty tuple is False
      •              a non-empty tuple is True
  7. Sets
    1. An unordered collection of unique values.
    2. A single set can contain values of any immutable data type.
    3. Implemented as classes
    4. Once you have two sets, you can do standard set operations
      •             union
      •             intersection
      •             set differences
    5. In a Boolean Context
      •            an empty set is False
      •            a non-empty set is True
  8. Dictionaries
    1. An “unordered” set of key-value pairs.
    2. When a key is added, a value for that key must also be added.
    3. Python dictionaries are optimized for retrieving the value when you know the key, but not the other way around.
    4. You can have duplicate values, but not duplicate keys.
    5. Assigning a new value, overwrites the old one.
    6. Case sensitive
    7. Can contain a collection of any type (mixed types allowed)
    8. Like lists and sets, the len() function gives the number of key-value pairs in the queue.
    9. In a Boolean Context
      •             an empty dictionary is always False
      •             a dictionary with at least one key-value pair is True
  9. The value None
    1. Is a special constant, it’s a null value, not the same as False, not zero, and it is not an empty string.
    2. Comparing None to anything other than None will always return False
    3. In a Boolean Context
      •             None is False
      •             anything else other than None is True

, ,

Leave a comment

Some rough character sketches….

After what seems like forever, I was able to manage a few basic character sketches that start to show the direction I’m looking for.  The guy with the glasses (aka Teddy) was the hardest of all.

A few (verrry) rough sketches

, ,

Leave a comment

%d bloggers like this: