ThePythonGameBook

learn Python. Create Games

User Tools

Site Tools


en:secret:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:secret:start [2013/07/04 20:40]
Horst JENS
en:secret:start [2014/01/09 11:07] (current)
Line 1: Line 1:
 ====== secret ====== ====== secret ======
 +~~NOCACHE~~
 stuff that i try out and that should not be seen (yet) stuff that i try out and that should not be seen (yet)
  
 +here a slow, detailed Goblin tutorial with everything explained in a tedious way:
  
-===== Goblins =====+  * [[step001|start the slow goblins tutorial]]
  
-Let's image two (not too bright) goblins doing there favorite sport playing gobling dice, 
-aka hitting each other on the head with big clubs. 
  
-The last gobling standing is usually the winner. 
  
-Let us call the goblins "​Stinky"​ and "​Grunty"​ and simulate their game using python, to save 
-them the many headaches from hitting each other, while allowing us to learn a thing or two about  
-game programming. 
- 
-=== hitpoints === 
- 
-The first game concept necessary is the concept of hitpoints. Hitpoints is an integer value describing 
-how many hits (on his head) a gobling can suffer before going down.  
-Computer game players should be familiar with concept of hitpoints. In many computer games, but also pen-and-paper role-playing games, hitpoints are represented by a green bar or some other visual indicator as well as displayed as numbers. 
- 
-=== Variables === 
- 
-To simulate Grunty and Stinky in all their robustness in python, it is necessary to create 2 variables. A variable is something like a money box or piggy bank... a box (container) holding some money (value). Also a variable has a name, like "​pension fund" for a piggy bank. The point of a variable is that it's value ( the amount of money in the piggy bank) can change over time. (You add money or take some money out of the box). Thus the term variable in contrast to constants, like pi. 
- 
-In this example, i create the two variables 
-<code python> 
-hitpointsStinky = 55 
-hitpointsGrunty = 66 
-</​code>​ 
- 
-it is a good idea to write that in a python shell. you can however do this example directly in your webbrowser: 
-http://​www.pythontutor.com/​visualize.html#​code=hitpointsStinky+%3D+44%0AhitpointsGrunty+%3D+63&​mode=display&​cumulative=true&​heapPrimitives=true&​drawParentPointers=false&​textReferences=false&​showOnlyOutputs=false&​py=3&​curInstr=2 
  
  
Line 39: Line 15:
  
    
- 
/var/www/horst/thepythongamebook.com/data/attic/en/secret/start.1372963203.txt.gz ยท Last modified: 2014/01/09 11:07 (external edit)