Code:
( . )
) ( )
. ' . ' . ' .
( , ) (. ) ( ', )
.' ) ( . ) , ( , ) ( .
). , ( . ( ) ( , ') .' ( , )
(_,) . ), ) _) _,') (, ) '. ) ,. (' )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_______ __ _
| __ \ \ / / (_)
| |__) \ \_/ / __ ___ _ __ ___ __ _ _ __ _ __ _ ___
| ___/ \ / '__/ _ \| '_ ` _ \ / _` | '_ \| |/ _` |/ __|
| | | || | | (_) | | | | | | (_| | | | | | (_| | (__
|_| |_||_| \___/|_| |_| |_|\__,_|_| |_|_|\__,_|\___|
Hey Guys! Recently I've been working on something that I call PYromaniac. I'm not quit sure what the technical name for it is so I'll just describe it. Well to start off it is coded in Python using Pygame. The real purpose of it is to make programming in pygame easier. with this you can make a simple person move around the screen in a matter of about 23 lines of code. The best part in my opinion is that the API is sooo simple. Here's an example of how to make a moving sprite with a background:
[init.py]
Code:
GAME = game() #initialize game class and store it to "GAME"
playerImage = Game.loadAlphaImage("player.png")#load the image that will be the player
bgImage = Game.loadImage("bg.jpg")
bg = GAME.addSprite(bgImage,0,0,0,0)
player = GAME.addSprite(playerImage,100,100,0,0)# add sprite player at x100 y100 with a constant movement of x0 y0
[tick.py]
Code:
keyDown = 0
if GAME.isKeyDown(K_LEFT):
GAME.editSprite(player,3,-1) #change the players x movement attribute to -1
keyDown = 1
if GAME.isKeyDown(K_RIGHT):
GAME.editSprite(player,3,1)
keyDown = 1
if GAME.isKeyDown(K_UP):
GAME.editSprite(player,4,-1)#change the players Y movement attribute to -1
keyDown = 1
if GAME.isKeyDown(K_DOWN):
GAME.editSprite(player,4,1)
keyDown = 1
if keyDown == 0: #stop player movement if no key is pressed
GAME.editSprite(player,3,0)
GAME.editSprite(player,4,0)
GAME.renderSprites()
Thanks for reading this, and any feed back or ideas would be nice!