Sign in to follow this  
Crazylegs830

New to programming and need help with python/pygame graphics.

Recommended Posts

      Hello, I apologize in advance if this is in the wrong place. I have been developing games and programming with python for 4 days. And I am working on a very small, simple game and I am also using pygame aswell as blender and another simple modeling program. I have written all the code that I need I think and made some models , but how do I get my graphics to go scene by scene? I mean how do you show one scene, for example a menu and than bring it to the actual game?

 

Thanks for reading this.

Edited by Crazylegs830

Share this post


Link to post
Share on other sites

Remove all objects in the first scene, and then add all the objects in the second scene. This would effectively put you in "scene 2", assuming that all your game logic runs on the objects themselves.

 

Beyond that, you should research simple state machines.

 

PS: Blender actually comes with an internal game engine, so you might want to give that a try (google Blender Game Engine).

Share this post


Link to post
Share on other sites

Ok thanks I think I understand ill try the blender game engine and try what you were talking about thanks ill get back to you on if I get it right. Any more help would be appreciated.

Edited by Crazylegs830

Share this post


Link to post
Share on other sites

When learning programming I actually started with Python. Then I found out about the different game libraries. Pygame was one of them. I got frustrated and started to look around more. The Blender Game engine is not set up that good. Unity3D costs too much to publish, however free it may be at first. I eventually found Maratis3D; been using it since.

 

For 2d games GAMEMAKER STUDIO, easy to use, but again, it costs to publish. 

 

There is actually a separate library for creating menus with python (yes, I checked that out too) which is probably what you want to look into. 

 

For pygame tutorials, you might want to check out these videos:

 

http://www.youtube.com/playlist?list=PL6AB5A7BBDC915599

 

These are the best I could find. He also has basic python videos. 

 

Hope this helps. 

Share this post


Link to post
Share on other sites

I know how to create graphics but how do I make it go from scene to scene. I mean frame to frame. The game I am making is very small and would probably have a max of 10 frames.

Edited by Crazylegs830

Share this post


Link to post
Share on other sites

Alright I have tried wxpython and do like it a lot thank you very much for that , but I just need to know how to have it go frame to frame. For example you press 1 and a new scene appears.

Share this post


Link to post
Share on other sites
Ahh okay, you will want to do some Event Driven Programming. A key press is an event. So in your code you will need an Event Handler.

Found a tutorial on it for python

http://www.youtube.com/watch?v=k_7WUPN0krU&sns=em

There should be a similar function to getScreen() in the wxpython library.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this