engine.hole documentation - wladekpal/The-Lazy-Snek GitHub Wiki

engine.hole.Hole

Field subclass simulating tunnel where two snakes or convex blocks can overlap while heading in perpenticular directions.

Properties:

  • inherited from Field
  • plugged_hole_field - Field object, represents Hole after being plugged by box
  • plugged - boolean informing if hole was plugged

Constructor

Takes direction. Constructor method, sets class attributes and loads texture.

set_coordinates(coordinates):

Method used to set coordinates attribute.

set_board(board)

Method used to set board attribute.

check_snake_move(snake)

Method that returns True if snake can enter, False otherwise.

snake_entered(snake)

Method that simulates snake enterance.

snake_left()

Method that simulates snake exit.

remove_snake(snake)

Method used to remove snake from field.

place_snake(snake)

Method has no effect.

remove_flat()

Method has no effect.

place_flat(flat)

Method has no effect.

check_convex_move(direction)

Method that returns True if convex can enter the field, False otherwise.

convex_entered(convex, direction)

Method that simulates convex enterance.

convex_left()

Method used to simulate convex exit.

remove_convex()

Method used to remove convex.

place_convex(convex)

Method has no effect.

self_draw(frame, draw_coords, side_length)

Method used to display hole on screen. If hole is plugged, it displays field representing plugged hole, otherwise hole is displayed.

try_placing(block)

Method always returns false.

has_removable()

Method always returns false.

request_removable()

Method always returns None.