Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Funcion CharacterCheckRight();
- u16 CharacterCheckRight(s8 add) {
- // Variables
- s32 x, y;
- s32 fx, fy;
- s32 start, end;
- s16 tile = 0;
- s16 result = T_AIR;
- // Variables de posicion
- fx = (CHARACTER.pos_fx >> 8);
- fy = (CHARACTER.pos_fy >> 8);
- // Calcula el rango de tiles a analizar
- x = (fx + CHARACTER.right + add);
- start = (fy - CHARACTER.up[0]);
- end = (fy + CHARACTER.down);
- // Analiza los tiles del lateral (steps de 1/2 tile)
- for (y = start; y <= end; y += 4) {
- tile = NF_GetTile(MAINMAP_SLOT, x, y);
- // Si el tile es pared...
- if (tile == T_WALL) {
- result = T_WALL;
- y = end;
- }
- }
- // Devuelve el resultado
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement