Level (Smash Hit)

knLevelHitSomething([player: integer])

Causes the player to crash and loose balls.

Parameters:

player – Player ID

knLevelStreakAbort([player: integer])

Aborts the player’s streak “properly”, e.g. plays the sound in addition to dropping the streak.

Parameters:

player – Player ID

knLevelStreakInc([player: integer])

Increments the player’s streak “properly”, playing sounds and giving any relevant achievements.

Parameters:

player – Player ID

knLevelAddScore(score: integer, [player: integer])

Adds balls to the player “properly”, playing sounds and giving any relevant achievements.

Parameters:
  • score – Amount of score (balls) to add

  • player – Player ID

knShoot(
    x: number,
    y: number,
    force: number,
    _unk: boolean,
    [player: integer]
)

Shoot a ball from the given x and y coordinates on the screen.

Parameters:
  • x – X pixel coordinate on the screen to shoot from

  • y – Y pixel coordinate on the screen to shoot from

  • force – The force with which to shoot the ball. This is always 20.0 in the base game.

  • _unk – Boolean with unknown function. This is seemingly always true in the base game.

  • player – Player ID

Note

It’s a good idea to look at Level::handleInput() to see how the vanilla game uses this function.

Player Parameter

When functions take a player parameter, it can be one of the following values:

  • -1: The singleplayer player

  • 0: Player on the left

  • 1: Player on the right

Changed in version 22: The player parameter now defaults to -1. Before it was undefined and defaulted to 0 as a result.