Target
A pinball target, with no code: the ball hitting it scores its Points and lights it up, and a drop target (Drops) falls out of the way. Once every target in its set (those inside the same entity) is lit, the set scores its CompletePoints and sends CompleteMessage, and they all come back up unlit ResetAfter seconds later.
Part of the Physics Games module: Physics puzzlers: a Slingshot to pull back and launch shots from, and Breakable things (planks, panes, blocks, pigs) that crack and break on hard knocks; a LevelGoal that wins a level once its targets are down (with a bonus for the shots left, and one to three stars) or loses it once the shots run out; a Slingshot and a Tower to make from the Entity menu (Genres, Physics Games); and the Physics template, levels of wood, glass and stone to knock down.
Put it on a solid collider. Its Message carries its points to a Counter keeping the score; its Lit, Down and Hits outputs are for a wire or a Counter, and the set’s Complete Message for a Trigger (an extra ball, a ball save, a door opening). Hits softer than its MinHit (the ball barely touching it) don’t count, and none count while a Tilt covering it has tilted. Unlit, its sprites are drawn darker; down, faint.
Requires: Collider (what the ball hits)
Works with: Counter (keeps the score from its Message (on another entity))
Changes how its entity is drawn (a tint, a shake or drawing it on top).
Properties
Section titled “Properties”Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.
points: a whole number = 250. What a hit scores: the data its Message carries. 0 sends the entity. (Field: a number.)message: text = “Score”. A message sent with Game.Send as it’s hit, with its Points as its data. (Names a message.) (Field: a name.)drops: true or false = false. A drop target: hit, it falls out of the way (nothing bumps into it) until its set comes back up. (Field: on or off.)minHit: a number = 0.5. How hard the ball has to hit it to count (a ball of Mass 1 at 2 units a second hits 2). (Field: a number.)layers: text = null. The collision layers that hit it, e.g. “Ball”. Empty is any body (but flippers). (Names collision layers: their names, separated by commas.) (Field: a name.)sound: text = null. A sound played as it’s hit, e.g. “Sounds/target.wav”. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
completePoints: a whole number = 1000. What lighting every target in its set (those inside the same entity) scores, as the data of its Complete Message. (Field: a number.)completeMessage: text = “Score”. A message sent as every target in its set is lit, with the set’s points as its data, e.g. “Score”. (Names a message.) (Field: a name.)resetAfter: a number = 1.5. Seconds after its set is complete before they all come back up unlit; 0 leaves them lit (until Reset). (Field: a number.)
lit: true or false = false. True once it’s been hit, until its set comes back up (or its Reset action). (Field: on or off.)down: true or false = false. True while a drop target lies down out of the way. (Field: on or off.)hits: a whole number = 0. How many times it’s been hit. (Field: a number.)resetIn: a number = 0. Seconds until its set comes back up; 0 when it isn’t due to. Set by the game. (Field: a number.)
Actions
Section titled “Actions”What anything can make it do with no code: a Trigger’s do when its message arrives, a Contraptions Wire’s input as its signal comes on, a script’s Game.Do(entity, “Name”).
Light. Lights it as if hit, scoring nothing (a set completed this way still scores).Reset. Brings it back up, unlit.
Outputs
Section titled “Outputs”What anything can read with no code: a Counter’s, Bar’s or Text’s output, a Contraptions Wire’s output as its signal; Text shows names too, the rest read numbers, true as 1.
Lit(true or false). True once it’s been hit, until its set comes back up (or its Reset action).Down(true or false). True while a drop target lies down out of the way.Hits(a whole number). How many times it’s been hit.
Scripts use it as Target: its methods, events and values that aren’t saved with the scene.