Skip to content

Sprite, Termination, and Interaction Data Class

Raluca D. Gaina edited this page Feb 12, 2018 · 2 revisions

Sprite Data Class

SpriteData class holds information about the in game sprites. The following table contains all the different data that can be accessed:

SpriteData Class Description
String type The type of the current sprite (refer to sprite types in VGDL section)
String name The name used for the current sprite
ArrayList<String> sprites Array of all sprite names that depends on this current sprite. For example in aliens, this is the definition of the avatar sprite: avatar > FlakAvatar stype=sam. This example shows that the sam sprite depends on the avatar sprite.
boolean isAvatar tells you if that sprite is an avatar sprite.
boolean isNPC tells you if that sprite is an NPC sprite.
boolean isPortal tells you if that sprite is a Portal sprite.
boolean isResource tells you if that sprite is Resource sprite.
boolean isStatic tells you if that sprite is Static sprite (not movable).
boolean disabled tells you if that sprite is disabled (avatars get disabled when they die).

You can't have more than one true boolean variable but all of them can be false. Having all of them as false means its a Movable sprite but not NPC.

Termination Data Class

TerminationData class holds information about how the game should terminate. The following table describes the data holds inside the class:

TerminationData class Description
String type The type of the termination condition which any of the three termination conditions described here.
ArrayList<String> sprites Array of all sprites that are used in the termination condition checking.
int limit An integer number used in the comparison of the termination condition.
String win Check if this condition is a winning or losing condition. In multi player games, win states for all players must be specified, separated by a comma (e.g. win=True,False means that the first player wins, the second loses).

Interaction Data Class

InteractionData class holds information about the consequences of the collision between two game sprites. The following table describes all the data provided through the class:

InteractionData class Description
String type The type of the action happened to the first sprite due to the collision. The list of different actions can be found here.
String scoreChange The change in score due to this interaction. Zero means it doesn't affect score. In multi player games, score changes for all players must be specified, separated by a comma (e.g. scoreChange=3,-10 means that the first player gets +3 points, while the other loses 10).
ArrayList<String> sprites List of sprite names that are used in the current action type (for example spawnIfHasMore spawns a certain sprite if the avatar has more than or equal to a certain amount of resource).

Table of Contents:

Clone this wiki locally