Thanks to some help from Oluseyi I managed to adapt my program so that I display a predefined map on the background.
Here is the code:
Here is the code:
#Setup: I import all the modules here
import sys
import os
import pygame
import random
import math
from pygame.locals import *
progpath = os.getcwd()+"/"
keys=[False]*324
snow…
In my quest to figure out how to make only the current position of the snow image show (instead of leaving a trail) I discovered that I should be using pygame sprites as they make life much easier. As a bonus I learned how to support the mouse.
Current code here:
Current code here:
#Setup: I import all the modules here…
I took my event handler out a step and added drawing to the screen. I draw a 16x16 .bmp of snow I made in paint to the screen. You can move it around with the WASD keys. It leaves a trail like the spraypaint feature in paint. I guess the next step is to add a clearing function.
#Setup
import sys
impo…
Well, life got in the way of making it through the OpenGL project. I made it a bit further but never seemed to get around to posting about it. I was studying to get into law school and working on starting my website Crazy Hakiko's Classic Play
based on classic computer, console, and tabletop RPGs. …
based on classic computer, console, and tabletop RPGs. …
The last couple of days I have been working through the program at the end of
Chapter 4 of the OpenGL book. It includes almost all of the concepts presented so far
so it makes a good review. Its over 800 lines of code so this will be a long entry.
The define/include section contains an entry I have …
Chapter 4 of the OpenGL book. It includes almost all of the concepts presented so far
so it makes a good review. Its over 800 lines of code so this will be a long entry.
The define/include section contains an entry I have …
The weekend was pretty busy but I did manage to get some work in on programming. I moved through chapter 3 of OpenGL Game Programming. This chapter covers some of the mathematics of 3D game programming. It was all pretty standard: vectors, cross product, dot product and matrix transformations. Ther…
I don't really have any time to spend on programming today because my wife and I have to get ready for our Vietnamese new year party. Tet is the Vietnamese new year celebration. For many Americans the word Tet has a negative connotation, however it is a period of celebration and renewal.
I should pr…
I should pr…
Today I took a look at the next few sections of the book. My goal for the day was to get the first full program working. The first program creates a window and then draws a triangle and rotates it. As usual I want to understand how everything I use works. I did have to suspend this to a certain poi…
After downloading the super helpful Win32 help files I was ready to start my programming work for the day.
Goal: Get a real window (not a message box) up and understand every line of code I used. Then mess around with it a bit to increase my understanding of how all the parts work.
After reading thro…
Goal: Get a real window (not a message box) up and understand every line of code I used. Then mess around with it a bit to increase my understanding of how all the parts work.
After reading thro…
Well, this is my first journal entry. I have been fooling around with programming for a while, and I took a few C and C++ classes in college. I use MATLAB at work so I have some programming background (not much).
I currently work as a mechanical engineer designing homeland security barriers (big cab…
I currently work as a mechanical engineer designing homeland security barriers (big cab…
Advertisement
Popular Blogs
Advertisement