ผลต่างระหว่างรุ่นของ "Prg2/monkey game"

จาก Theory Wiki
ไปยังการนำทาง ไปยังการค้นหา
แถว 15: แถว 15:
 
=== Final code ===
 
=== Final code ===
 
We notice that there are many duplicate lines in Sprite and Text (in <tt>gamelib.py</tt>).  Therefore, we extract a new base class, called <tt>GameCanvasElement</tt> from both classes.  We also have to update all attributes from <tt>sprites</tt> to <tt>elements</tt> so as to be more inclusive about things inside the list.
 
We notice that there are many duplicate lines in Sprite and Text (in <tt>gamelib.py</tt>).  Therefore, we extract a new base class, called <tt>GameCanvasElement</tt> from both classes.  We also have to update all attributes from <tt>sprites</tt> to <tt>elements</tt> so as to be more inclusive about things inside the list.
 +
 +
: See the diff here: [https://github.com/jittat/monkeys-demo/commit/d07e9ac733a38bf47b1f22ba753d3a8f7c0eb968]
  
 
This is the edit history for the game.
 
This is the edit history for the game.
  
 
[[Image:Prg2-monkey-edit-history.png]]
 
[[Image:Prg2-monkey-edit-history.png]]

รุ่นแก้ไขเมื่อ 00:41, 9 มีนาคม 2564

This is part of Programming 2 2563

Basic information

Materials

Part 1

Part 2

Part 3

Final code

We notice that there are many duplicate lines in Sprite and Text (in gamelib.py). Therefore, we extract a new base class, called GameCanvasElement from both classes. We also have to update all attributes from sprites to elements so as to be more inclusive about things inside the list.

See the diff here: [1]

This is the edit history for the game.

Prg2-monkey-edit-history.png