Misc Functions

```
Start positions are the top left corner of the play area. Width and Height are for the play field.

**Returns** N/A

### **SetPlayerBoundary**

```
Arguments:
     1. Left
     2. Right
     3. Top
     4. Bottom

```
Boundaries for player movement.

**Returns** N/A

### **SetPlayerSpawn**

```
Arguments:
     1. Spawn X
     2. Spawn Y
     3. Go To X
     4. Go To Y

```
Spawn point will generally be under the screen and the Go To point is where the player moves to before you regain control.

**Returns** N/A

### **GameEnd**

```
Arguments:
     N/A

```
Ends the game, showing the score screen.

**Returns** N/A

## GUI Setup

The GUI (Interface around the play area) is set up at game initialization. It will remember to do these every frame (there for the "Add" in the function names).

### **GUISetBackground**

```
Arguments:
     1. Sprite

```
Sets the background for the game interface.

### **GUIAddText**

```
Arguments:
     1. x
     2. y
     3. String

```
Tells the game to draw a String on the interface every frame

### **GUIAddVariable**

```
Arguments:
     1. x
     2. y
     3. Variable

```
Tells the game to draw a Variable number on the interface every frame. These include:

* 'score'
* 'lives'
* 'bombs'
* 'power'
* 'power/max'
* 'powerFloor'
* 'powerFrac'
* 'powerMax'
* 'graze'

### **GUIAddSpriteRow**

```
Arguments:
     1. x
     2. y
     3. Variable
     4. Max
     5. Images per row
     6. Sepatation
     7. Image 1
     8. Subimage 1
     9. Image 2
     10. Subimage 2

```
This function is intended mainly to draw life hearts and bomb stars. The variable is the same as the above function (but obviously use with caution where it may not get sensible returns)

### **GUIAddSetFont**

```
Arguments:
     1. Font

```
Adds a font change to the GUI

### **GUIiAddSetHAlign**

```
Arguments:
     1. Alignment

```
Sets how to align text along the horizontal axis

* FA\_LEFT
* FA\_CENTER
* FA\_RIGHT

### **GUIAddSetVAlign**

```
Arguments:
     1. Alignment

```
Sets how to align text along the vertical axis

* FA\_TOP
* FA\_MIDDLE
* FA\_BOTTOM

### **GUIAddSetColor**

```
Arguments:
     1. Color

```
Sets the draw color

### **GUIAddSetAlpha**

```
Arguments:
     1. Alignment

```
Sets the draw alpha

## Variable Getters

### **GetX**

```
Arguments:
     1. Instance

```
**Returns** x position

### **GetY**

```
Arguments:
     1. Instance

```
**Returns** y position

### **GetDir**

```
Arguments:
     1. Instance

```
**Returns** Direction

## Variable Setters

### **SetLives**

```
Arguments:
     1. Lives

```

### **SetBombs**

```
Arguments:
     1. Bombs

```

### **SetPower**

```
Arguments:
     1. Power

```

### **SetContinues**

```
Arguments:
     1. Continues

```

### **SetBulletItem**

```
Arguments:
     1. Bullet power up item to drop

```

### **SetXY**

```
Arguments:
     1. Instance
     2. x
     3. y

```

### **SetDrawColor**

```
Arguments:
     1. Instance
     2. Color

```
Sets the draw color for a shot or drawn sprite (note, not the bullet color itself but blend color)

**Returns** True if successful

### **SetDrawAlpha**

```
Arguments:
     1. Instance
     2. Alpha

```
Sets the draw alpha for a shot or drawn sprite

**Returns** True if successful

## Sound

### **PlayBGM**

```
Arguments:
     1. BGM
     2. Loop (True/False)

```

### **PlayWav**

```
Arguments:
     1. Loaded Wav
     2. Overlap (True/False)

```

### **BGMSetLoop**

```
Arguments:
     1. BGM
     2. Start sample
     3. End sample

```

### **BGMFadeOut**

```
Arguments:
     1. Duration of fade out

```

## Pickups

### **PickupCreate**

```
Arguments:
     1. x
     2. y
     3. Type

```
Creates a pickup item. Item types are:

* ITEM\_POWER
* ITEM\_POWER8
* ITEM\_STAR
* ITEM\_LIFE
* ITEM\_BOMB
* ITEM\_FULL
* ITEM\_SCORE

**Returns** it's ID

## Dialogue

### **DialogueAdd**

```
Arguments:
     1. Instance to show dialogue at
     2. String of text (\n is new line)
     3. Duration between each character typing in (0 for instant)

```
**Returns** it's ID

### **DialogueRemove**

```
Arguments:
     1. Dialogue ID

```

### **DialogueReset**

```
Arguments:
     1. Clears all dialogue

```

### **DialogueEnd**

```
Arguments:
     1. Ends the dialogue

```

### **DialogueWait**

**Returns** True if dialogue is currently displayed, false if not