Jump to content

  • Log In with Google      Sign In   
  • Create Account


dmreichard

Member Since 24 Apr 2005
Offline Last Active Jun 27 2013 03:54 PM
-----

Posts I've Made

In Topic: Movement Game Logic in a Python Text-Based Game

08 June 2013 - 11:25 PM

However I am a bit stuck on how to simulate player movement in Python. I looked around the internet for movement logic specifically in Python, but so far I have had no luck. So I come to you guys, the experts. Does anyone have a good method of simulating player movement? In case anyone is interested I am 51% of the way through the CodeAcademy Python track so I haven't completely learned the basics of Python yet.

 

From reading this it sounds like you are attempting to tackle a project a bit out of your scope at the moment. Let me clarify something first that there is no "movement logic" specifically in Python. Python is simply a programming language, a tool. To solve the problem of how to simulate player movement would involve thinking about how you are breaking down the representation of your player and a room. What data structures are you going to use to represent these game entities? Will rooms have references to each other by cardinal directions and a list of game objects and/or players?

 

I think you should read more about Python and experiment with classes, modules etc. before tackling a text based RPG. One way to think about programming is taking a large problem and dividing that into several smaller problems to solve then piecing it all back together. The language itself is simply a tool or means to an end however, if you don't know how to use the tool with some proficiency your problem will be rather hard to solve indeed.


In Topic: PyGame Sprite Sheet Help

06 March 2013 - 11:04 AM

Before working on how to handle sprite sheets I would recommend some reading on Python classes and attributes. http://docs.python.org/2/tutorial/classes.html#class-objects will specifically point out some flaws I saw from a quick glance with how you are handling your Character base and sub classes, specifically in regards to class objects and attribute references.

 

Once you read about class objects (I would recommend you read the entire tutorial on Python classes) take a look at how you are handling characters. You will be able to see which items should be attribute references, and which should be data attributes.

 

Learning more about Python classes will help you towards cleaning up your code. As for handling sprite sheets a simple google search for "pygame sprite sheet" will give you very useful results. There are actually several code snippets that people wrote for handling just that in PyGame.

 

Happy coding!


In Topic: Trouble with importing my own modules

02 March 2013 - 08:12 PM



I've made many programs using one file and am doing my new project this way to learn how to properly do it.

 

Sometimes using one file is the proper way to do it, depending on how you are structuring the code. How complex your game is would also have a big impact on how the code is layed out. As Bacterius mentioned, you are using Python modules like C++ headers. Try and treat modules like their name implies for a "modular" design. A google search for "python idioms" may yield some useful information.


In Topic: Any point Learning XNA?

26 February 2013 - 07:25 PM

there are 2 books by packt, one 3D and one 2D!

 

I'm going to have to check out their 3D book, the 2D one was excellent!


In Topic: Any point Learning XNA?

26 February 2013 - 07:01 AM

this book is very helpful: (for 3D)

http://www.packtpub.com/xna-4-3d-game-development-example-beginners-guide/

 

Just to point out, I think hikarihe meant for 2D, as the book listed above does not delve into 3D development. It is however an excellent book!


PARTNERS