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!
But doesn't pygame already make game development exceptionally easy? And on top of it, your game library doesn't look very flexible. Not to put this down, I just think this would be more a project for making your own games than a generic library for all game developers.
It's not nearly done yet and the other thing is that it allows for easy game modding for those who want it. It works on a folder system, so basicly all you have to do is put the files to that folder and they're now part of the code. This also makes it easy for bug fixes and maybe even a plugin system for your game if you want it. the other great thing is that the tick system is built in. all you have to do is make a file called init.py (for initiating all your variables) and tick.py (its run every tick). And of course the collision boxes are built in to the sprite so no needing to define them or update them, it's all done automaticly Also if you want have a bullet its as simple as
"bullet = gameObject.addsprite(preloadedBulletImage, xstart, ystart, xmove, ymove)".
If you want I could post the code just to show you that it realy is fairly simple to use (even compared to pygame).
This sounds pretty interesting, but for modding it would be nice to instead of having to overwrite a file to be able to dynamically add another folder which it searches in first.
I could add that. That sound like a good idea!
I agree with Ashbad, pygame is already extremely easy to use. And as Ashbad has pointed out these are probably better for you than for other game developers. I say this because if I use pygame I tend to write wrapper classes that do almost exactly what you are doing. They are things that all game developers do, and have their own preffered way to achieve this. But one thing I can say about this project is that if you are not already familiar with oop principles, this project can teach you a lot depending on your implementation.
well what I did involving OOP was make a whole new class I call "game" that can control every aspect of the game with pretty much just a few commands.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement