### Navigation

- index
- modules |
- next |
- previous |
- Pyskool 1.1.1 documentation »

# bike

Defines the `Bike` class.

class `bike.``Bike`(bike_id, command_list_id, initial_as, unchain_location, move_delay, pedal_momentum, max_momentum)

  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. move_delay – The delay between consecutive movements of the bike when wheeling along or being pedalled. pedal_momentum – The momentum increment when the bike is pedalled. max_momentum – The maximum momentum the bike can have.

  `fall`(rider=None)

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

    Parameters: | 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.

    Parameters: | lesson_id – The ID of the current lesson (ignored - bikes do not follow a timetable).

  `hit_barrier`()

    Return the wall or door that the bike has hit (if any).

    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.

    Parameters: | 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.

### Navigation

- index
- modules |
- next |
- previous |
- Pyskool 1.1.1 documentation »