bike

Defines the Bike class.

class bike.Bike(bike_id, command_list_id, initial_as, unchain_location)

The bike.

Parameters:
  • bike_id – The ID of the bike.
  • command_list_id – The ID of the command list the bike will use.
  • initial_as – The bike’s initial animatory state.
  • unchain_location – The location at which the bike will be deposited when it’s unchained from the tree.
fall(rider=None)

Make the bike fall over (as when it has lost momentum).

Parameter:rider (Character) – Whoever was riding the bike (if anybody).
get_command_list_id(lesson_id)

Return the ID of the command list used by the bike.

Parameter:lesson_id – The ID of the current lesson (ignored - bikes do not follow a timetable).
hit_barrier(barrier_id=None)

Check whether the bike has hit a barrier.

Parameter:barrier_id – If set, check whether the bike has hit the barrier with this ID; otherwise check all barriers.
Returns:The barrier that was hit, or None if none was hit.
pedal()
Pedal the bike (increase its momentum).
prepare()
Prepare the bike for riding by Eric. This entails giving the bike some initial momentum, and hiding its sprite.
start_wheeling(rider)

Start wheeling the bike along after the rider has dismounted or stood on the saddle.

Parameter:rider (Character) – The rider.
unchain()
Deposit the bike at the base of the tree (or whatever the unchain location is set to).
wheel()
Continue wheeling the bike along until it hits a barrier or runs out of momentum.
bike.MAX_MOMENTUM
The maximum momentum of the bike.
bike.PEDAL_MOMENTUM
The momentum increment when the bike is pedalled.
bike.SPEED
The speed of the bike.

Previous topic

barrier

Next topic

cast