Glossary - earok/scorpion-editor-demos GitHub Wiki
Actor
An actor (sometimes called a Game Object or an Entity in other frameworks) is a game object that can animate, can move, and can collide with some other actors and the environment. Excluding the player, most actors are configured to use CPU movement types.
There are various subclasses of actor, some of which are not mutually exclusive:
Attacker
An attacker actor has the ability to do an attack animation or launch an attack projectile.
A CPU actor will automatically attack as often as they're able to do so, whereas a player actor will only attack when the fire button is pressed.
Block collider
A block collider is a special kind of actor that allows for certain collision events against blocks. By default, both projectiles and players are block colliders while regular actors are not.
But you do have the flexibility to remove the flag from players or projectiles to boost performance, or add the flag to regular actors to boost flexibility.
Moving platform
A moving platform is a special kind of actor that allows other platformer actors to be carried by it. This could be used to simulate elevators and platforms that float across the level, as well as vehicles and animals that can be ridden by the player.
Any actor with 'Can Ride Platforms' set will be able to ride a moving platform.
New
The "new" actor is the one most recently created by a spawn or by another actor shooting, this makes it convenient to apply properties such as speed and direction on the next lines after the actor was spawned.
Player
A Scorpion Engine game usually has one or more “player” actors, which are typically set to a movement type like Control or Control_Platform. A player is intended to be controlled by a real human, and player actors have special collisions that others do not (such as being able to collide against non-player actors, and register special collisions against blocks, including overlapping blocks).
Any actor with 'Pursue Player' set will be able to chase the current player.
Projectile
A projectile is a special kind of actor that can collide with other actors that are not players. This includes other projectiles, so a game where your bullets could block the bullets of another enemy is possible.
While the flag is absolutely necessary for player bullets, using it on enemy bullets can be unnecessarily harmful to performance. The only reason why you might want to flag an enemy bullet as a projectile is if the enemies can harm each other, like as seen in the “monster infighting” of Doom, or in situations where bullets can collide with each other such as above. See the performance section for more details.
Animation
An animation is a sequence of images (frames) used to display an actor on screen.
Animation Events
Each frame can also have a number of events attached, for synchronizing sound effects, firing bullets, striking enemies and so on.
Melee attack animation event
A melee attack allows for simulating one actor punching or kicking another, as well as being able to destroy blocks. The "hurt box" variant allows for custom areas where the actor can be attacked.
Block
A block is a kind of dynamic tile that can be swapped out for any other block at run time, as well as trigger collision events. They’re far more performant than actors, and although they’re not as flexible, they can be used to simulate games like Snake, Tetris or Conway’s Game of Life.
In essence, they bridge the gap between actors and tiles, by being much more performant than the former and much more flexible than the latter.
Block animations
In order to simulate animations, blocks can be set to turn into other blocks on a constant set timer. They can form a chain, for example if you use blocks to represent a spinning coin, you may want to configure something like the following:
Coin1 -> Coin2 -> Coin3 -> Coin4 -> Coin1
Block slopes
A slope is a special kind of block. This is useful for creating hills in platformers that resemble games like Sega’s Sonic the Hedgehog, but it can also be useful for creating staircases. The shape of the slope is made out of the shape of the block itself.
Codeblock
A codeblock is a sequence of commands that are executed in linear order, in a similar fashion to traditional code. All Scorpion Engine games require at least one codeblock to be executed on startup.
The codeblocks that are listed in italics are ones bundled with the actual engine. Editing these is generally not recommended as it could change the behaviour of the engine itself.
Map (level)
A map (also known as a level) is a gameplay area constructed out of 16x16 pixel tiles.
While they’re typically used to make the actual gameplay, since they’re a lot more flexible than panels they can be used to create animated and dynamic menu systems and title screens.
Map Event
A map event is a rectangular area that can be used to trigger codeblocks when the player either:
- Enters the area
- Interacts with the area (pressing the fire button)
- Stays within the area
- Leaves the area
Or any combination of the above.
Map Event rectangles can also be flagged as “teleporters” so a player can teleport from one area to another. Teleporting from one level to another is also supported.
Map Layer
Maps are made out of overlapping layers. Events, Paths and Templates are always placed on an Object Layer, actors (excluding templates) blocks and tiles are always played on a Tile Layer.
Tile layers can be configured to be “foreground”, a foreground layer will typically render over top of actors. Layers can also be included or excluded on a platform-by-platform basis if you wish to include some layers only on certain systems, and different layers on other systems.
All tile layers are “flattened” at compile time down to a single 2D tile layer (with some special tricks for handling foreground tiles). This means that no matter how many layers you have, the time to render each tile remains constant.
Map Path
A map path is used by a CPU Path actor to move around a predetermined path.
Select an object layer, and use the polygon tool to draw the path on the map. Make sure the start of the path is on the same tile that your actor is placed in.
Map Template
While actors and blocks are typically added to a Scorpion Engine game through the actor and block tilesets, actors can also be added through the “template” system.
This offers a few advantages, including:
- Being able to position an actor on an exact X/Y pixel coordinate rather than being constrained to multiples of 16 pixels.
- Being able to set the “actor_var” variables.
- Being able to override the actor’s default codeblock events for OnSpawn and OnTimer.
If you’ve opened the automatically generated tiled project file in the Scorpion Engine project folder, you should be able to open the template view on any map in the project. Make sure to have the template layer selected when adding objects.
Panel
A “panel” is typically used to represent a static image, such as a title screen or a game over screen. This also extends to interactive panels, such as menu or shop screens, HUDs that are above or below the main game display, dialogue displays and so on. In some cases, they can even be used for parallax displays or Amiga copper rainbows.
Panel Elements
An element on a panel is a dynamic display of some information, such as lives or score. There’s several types of elements, which include: Bar - a bar indicator that fills up left to right Counter - display a variable value with tokens Digits - raw display of numbers Text - raw display of a text string
Panel Options
Certain panels can be used as options menus. As such, the position of each option can be defined in the panel, as well as how the options link together (if I press right on the current option, which option should be selected next for example).
Panel Talkpad
A “talkpad” can be added to some kinds of panels. This is a rectangular area where text can be printed character-by-character.
A codeblock event can be added to the talkpad for every character typed, this is typically used for events such as simulating the key strokes of a typewriter.
Recycling
In order to prevent a level with a lot of actors from overwhelming the CPU, actors can be “recycled” back into a frozen state once they’re too far from the camera to be rendered. These actors can be restored once the camera returns to their part of the level.
Recycling Types
- Always: This is the default for regular actors and the recommended option.
- Never: Actor is never recycled and is always active even if far from the camera. This is the default for players.
- Trash: Instead of being recycled, the actor is simply deleted when off screen. This is the default for projectiles.
- Default: Scorpion will pick one of the above based on other settings.
Recycling Options
- Recycle after destroy: A recycle operation will be triggered if an actor is destroyed on screen.
- Recycle to original position: Instead of being frozen in place, the actor will be recycled back to there it originally came from.
- Onspawn after recycle: The actor will run the “onspawn” event once again after being recycled, as though it was freshly spawned into the level.
Tag
A tag is a way to logically organize actors, animations and blocks into categories. These can only have one tag each, and their tags can be accessed in codeblocks to simplify logic.
Tile
A tile is the building block of levels. They’re static, 16x16 pixels in size and do not visually change - although they can be visually animated, and their properties can be replaced through code blocks or by simply placing a block on the top of them.
Tiles can be placed on a foreground layer in order to obscure actors behind them.
Tilesets
A tileset contains a link to an image with multiple tiles, as well as the configuration of each of the individual tiles.
Two special tilesets are automatically created and linked to every map in a Scorpion Engine project. One allows you to position the actors on the map, the other allows you to link the blocks on the map.
Typically, a tileset is the first thing created in a Scorpion Engine project - creating a map without a tileset is not possible.
Yield
A “yield” means a non-interrupting wait. For example, you might want something to happen to an actor (for it to be destroyed or change animation for example) ten frames in the future, without freezing the rest of the game for ten frames.
Yields can either be: On an individual actor On the level itself
Each actor and the level itself has a timer, running a yield replaces whatever yield there was previously. So if you trigger one yield for ten frames, and trigger another one before those ten frames are up, the code that was meant to run after the first yield will never trigger.
Using the OnTimer function on the Actor tab sets an automatic yield to happen every X number of frames.