The Python Game Book

code games. learn Python.

User Tools

Site Tools


en:pygame:step016

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
en:pygame:step016 [2020/05/03 21:04]
horst ↷ Links adapted because of a move operation
en:pygame:step016 [2020/05/03 21:35]
horst ↷ Links adapted because of a move operation
Line 3: Line 3:
 ^ [[:en:pygame:step015| ← previous]] ^ [[en:pygame:start| ↑ Overview]] ^ [[:en:pygame:step017| → next ]] ^ ^ [[:en:pygame:step015| ← previous]] ^ [[en:pygame:start| ↑ Overview]] ^ [[:en:pygame:step017| → next ]] ^
 ====== gameplay ====== ====== gameplay ======
-{{:en:part2:part2step016.jpg?400 |screenshot of layers}}+{{part2:part2step016.jpg?400 |screenshot of layers}}
  
 The source code example below is not much of a game, but it demonstrates the uses of layers for sprites and [[wp>Parallax_scrolling]] (the mountains). Also, you can hide penguins behind blocks and mountains. The source code example below is not much of a game, but it demonstrates the uses of layers for sprites and [[wp>Parallax_scrolling]] (the mountains). Also, you can hide penguins behind blocks and mountains.
Line 10: Line 10:
 **Trivia:**  **Trivia:** 
  
-[[http://www.arcade-museum.com/game_detail.php?game_id=8747|{{ :en:part2:moon-patrol.png|screenshot of moon-patrol. Picture from http://www.arcade-museum.com/game_detail.php?game_id=8747}}]]+[[http://www.arcade-museum.com/game_detail.php?game_id=8747|{{ part2:moon-patrol.png|screenshot of moon-patrol. Picture from http://www.arcade-museum.com/game_detail.php?game_id=8747}}]]
  
 According to wikipedia, Parallax scrolling was first introduced to computer games by the arcade game [[wp>Moon_Patrol]] 1982. The mountains (and in higher levels, futuristic buildings) moved at different speed to create the illusion of a [[wp>Side-scroller|side-scrolling computer game]]. According to wikipedia, Parallax scrolling was first introduced to computer games by the arcade game [[wp>Moon_Patrol]] 1982. The mountains (and in higher levels, futuristic buildings) moved at different speed to create the illusion of a [[wp>Side-scroller|side-scrolling computer game]].
Line 240: Line 240:
 ^  file  ^  in folder  ^  download  ^ ^  file  ^  in folder  ^  download  ^
 |  [[https://github.com/horstjens/ThePythonGameBook/raw/master/pygame/016_layers.py|016_layers.py]]  |  ''pygame''  |  Download the whole Archive with all files from Github:  \\  https://github.com/horstjens/ThePythonGameBook/archives/master  | |  [[https://github.com/horstjens/ThePythonGameBook/raw/master/pygame/016_layers.py|016_layers.py]]  |  ''pygame''  |  Download the whole Archive with all files from Github:  \\  https://github.com/horstjens/ThePythonGameBook/archives/master  |
-|  [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/babytux.png|babytux.png]] \\ [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/babytux.png|{{:en:part2:babytux.png|babytux.png}}]]  |  ''pygame/data''  |  :::  | +|  [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/babytux.png|babytux.png]] \\ [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/babytux.png|{{part2:babytux.png|babytux.png}}]]  |  ''pygame/data''  |  :::  | 
-|  [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/babytux_neg.png|babytux_neg.png]] \\ [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/babytux_neg.png|{{:en:part2:babytux_neg.png|babytux_neg.png}}]]  |  ''pygame/data''  |  :::  |+|  [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/babytux_neg.png|babytux_neg.png]] \\ [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/babytux_neg.png|{{part2:babytux_neg.png|babytux_neg.png}}]]  |  ''pygame/data''  |  :::  |
 |  [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/claws.ogg|claws.ogg]]  \\  from Battle of Wesnoth  |  ''pygame/data''  |  :::  | |  [[https://github.com/horstjens/ThePythonGameBook/blob/master/pygame/data/claws.ogg|claws.ogg]]  \\  from Battle of Wesnoth  |  ''pygame/data''  |  :::  |
  
en/pygame/step016.txt · Last modified: 2020/05/15 22:50 by horst