ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
collision.c File Reference
#include "../../ugbc.h"

Go to the source code of this file.

Functions

Variablecollision_to (Environment *_environment, int _sprite)
 Emit ASM code for = COLLISION([int]x).
Variablecollision_to_vars (Environment *_environment, char *_sprite)
 Emit ASM code for = COLLISION([expression]).

Function Documentation

◆ collision_to()

Variable * collision_to ( Environment * _environment,
int _sprite )

Emit ASM code for = COLLISION([int]x).

This function can be used to issue code aimed at verifying if a sprite has had a collision with another sprite. The result (0 = no collision, 0xff = collision occurred) is returned in the output variable. This function is used when a direct integer is used.

Parameters
_environmentCurrent calling environment
_spriteInteger with the bitmask of the sprites
Returns
Variable* Temporary variable with the result of collision (0 = no collision, 1 = collision occurred)

Definition at line 57 of file collision.c.

◆ collision_to_vars()

Variable * collision_to_vars ( Environment * _environment,
char * _sprite )

Emit ASM code for = COLLISION([expression]).

This function can be used to issue code aimed at verifying if a sprite has had a collision with another sprite. The result (0 = no collision, 0xff = collision occurred) is returned in the output variable. This function is used when an expression is used.

Parameters
_environmentCurrent calling environment
_spriteExpression with the bitmask of the sprites
Returns
Variable* Temporary variable with the result of collision (0 = no collision, 1 = collision occurred)

Definition at line 79 of file collision.c.