An Abstract Data type representing a snake character object.
More...
|
def | __init__ (self, blockSize, direct, speed, axis) |
| Snake constructor. More...
|
|
def | draw (self, x, y) |
| Draw method uses pygame to draw the snake object. More...
|
|
An Abstract Data type representing a snake character object.
def Snake.Snake.__init__ |
( |
|
self, |
|
|
|
blockSize, |
|
|
|
direct, |
|
|
|
speed, |
|
|
|
axis |
|
) |
| |
Snake constructor.
Initializes a Snake object with its initial attributes
- Parameters
-
blockSize | the width and height of the square block representing the snake |
direct | The direction of the snake's movement |
speed | The initial speed of the snake's movement |
def Snake.Snake.draw |
( |
|
self, |
|
|
|
x, |
|
|
|
y |
|
) |
| |
Draw method uses pygame to draw the snake object.
- Parameters
-
x | The x-coordinate where the block should be drawn |
y | The y-coordinate where the block should be drawn |
The documentation for this class was generated from the following file: