PyGameEngine Release 1 Now Available!

The source for PyGameEngine release 1 is now available at pyedpypers.org. There is also a discussion topic there. The highlight of this first release is the camera class.
The camera class is designed to work seamlessly with the game class provided by the game engine. It allows you to focus on one point at a time. It comes with a useful function just for centering on a set of coordinates. It also can be constrained to not pass too far off the screen. There’s much more to come as well.

The project’s page is located at http://pyedpypers.org/index.php?page=project&projectid=45&view=true

Advertisements

PyGameEngine

I began work today on a new game engine for use with Pygame. Right now, it only has classes and functions to facilitate cameras and camera movement. There’s also a working demo for the camera class. It is in a pre-alpha version and has many known bugs. Including ones as simple as making a background larger than the camera. But it seems more stable than many other engines out there.

Here’s an example of a simple use of the game engine:

from PyGameEngine import *

class NewSprite(GameSprite):

...

def main():
background = pygame.surface.Surface((800,600))
background.fill((65,0,0))
pygame.draw.line(background, (255,255,255), (0,0), (background.get_rect().width-1, 0), 9)
pygame.draw.line(background, (255,255,255), (background.get_rect().width-1, background.get_rect().height-1), (background.get_rect().width-1, 0), 9)
pygame.draw.line(background, (255,255,255), (0, background.get_rect().height-1), (background.get_rect().width-1, background.get_rect().height-1), 9)
pygame.draw.line(background, (255,255,255), (0, 0), (0, background.get_rect().height-1), 9)

game = Game(screensize=(800, 600), caption="PyGameEngine testing", background=background, bgcolor=Color(40,0,0), backgroundfixed=False, fullscreen=False, maxfps=30, debug=True)

spritesurf = pygame.surface.Surface((32, 32))
spritesurf.fill((255,255,255))
testSprite = NewSprite(game, image=spritesurf, bounds=Rect(0,0, 800,600))
game.centerOn = testSprite
testSprite.centerOn(Rect(0,0, 800,600).center)
testGroup = GameSpriteGroup(game, [testSprite])
game.addGroup(testGroup)
game.playersprite = game.groups[0].sprites()[0]

game.run()

if __name__ == '__main__':
main()

I will upload the source code as soon as I feel it’s ready. I may upload a video of the working demo though.

Introduction

Welcome to my new feed, Novice to Pro. Here I will post various findings I stumble upon in my journey from Novice to Pro.

I am an unproffesional programmer, I am self-taught and use Python primarily. Although I do know the basics of a handful of languages. Besides Python, I use C++, C#, Javascript, CSS, HTML, and a few others I can’t think of at the moment. When using Python, I normally write games using the excellent Pygame library. I’ve tried a few others like pyglet and rabbyt, but none of them seemto really compare to Pygame’s simplicity and power.
Anyway, enough rambling on about Python, let’s talk about this blog. Novice to Pro is aimed to be a place with all the knowledge I wish I had when I was learning. I’ve already found a few useful tips and tricks that I’ll be sharing shortly after this post, but keep in mind that NtP will be formuch more than just programming.

Now, if you’re intrigued, subscribe, if not, don’t. Just keep it in mind for a later date.