mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2025-01-30 23:00:16 -05:00
Update gamebuino
This commit is contained in:
parent
fdbe6aa55f
commit
0405cd84d0
@ -256,9 +256,12 @@
|
||||
#define SFG_WEAPON_IMAGE_POSITION_X \
|
||||
(SFG_GAME_RESOLUTION_X / 2 - (SFG_WEAPON_IMAGE_SCALE * SFG_TEXTURE_SIZE) / 2)
|
||||
|
||||
#if SFG_GAME_RESOLUTION_Y > 50
|
||||
#if SFG_GAME_RESOLUTION_Y > 70
|
||||
#define SFG_WEAPON_IMAGE_POSITION_Y \
|
||||
(SFG_GAME_RESOLUTION_Y - (SFG_WEAPON_IMAGE_SCALE * SFG_TEXTURE_SIZE))
|
||||
#elif SFG_GAME_RESOLUTION_Y > 50
|
||||
#define SFG_WEAPON_IMAGE_POSITION_Y (SFG_GAME_RESOLUTION_Y \
|
||||
- ((SFG_WEAPON_IMAGE_SCALE * 3 * SFG_TEXTURE_SIZE) / 4))
|
||||
#else
|
||||
#define SFG_WEAPON_IMAGE_POSITION_Y \
|
||||
(SFG_GAME_RESOLUTION_Y - SFG_TEXTURE_SIZE / 2)
|
||||
@ -559,7 +562,11 @@ SFG_PROGRAM_MEMORY uint8_t SFG_projectileAttributeTable[SFG_PROJECTILES_TOTAL] =
|
||||
/* fireball */ SFG_PROJECTILE_ATTRIBUTE(10,1000),
|
||||
/* plasma */ SFG_PROJECTILE_ATTRIBUTE(18,500),
|
||||
/* dust */ SFG_PROJECTILE_ATTRIBUTE(0,450),
|
||||
#if SFG_FPS < 20
|
||||
/* bullet */ SFG_PROJECTILE_ATTRIBUTE(20,1000) // high speed could miss things
|
||||
#else
|
||||
/* bullet */ SFG_PROJECTILE_ATTRIBUTE(28,1000)
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // guard
|
||||
|
@ -16,21 +16,28 @@
|
||||
|
||||
#define SFG_ARDUINO 1
|
||||
#define SFG_CAN_EXIT 0
|
||||
#define SFG_FPS 30
|
||||
#define SFG_SCREEN_RESOLUTION_X 80
|
||||
#define SFG_FPS 17
|
||||
#define SFG_SCREEN_RESOLUTION_X 78
|
||||
#define SFG_SCREEN_RESOLUTION_Y 64
|
||||
#define SFG_RESOLUTION_SCALEDOWN 1
|
||||
#define SFG_RAYCASTING_MAX_STEPS 20
|
||||
#define SFG_RAYCASTING_MAX_HITS 5
|
||||
#define SFG_RAYCASTING_SUBSAMPLE 2
|
||||
#define SFG_RAYCASTING_MAX_STEPS 11
|
||||
#define SFG_RAYCASTING_MAX_HITS 3
|
||||
#define SFG_RAYCASTING_SUBSAMPLE 3
|
||||
#define SFG_DIMINISH_SPRITES 0
|
||||
|
||||
#define SFG_DITHERED_SHADOW 0
|
||||
|
||||
#include "game.h"
|
||||
|
||||
Gamebuino_Meta::Color palette[256];
|
||||
|
||||
uint8_t blinkFramesLeft;
|
||||
|
||||
void blinkLED(Gamebuino_Meta::Color color)
|
||||
{
|
||||
gb.lights.fill(color);
|
||||
blinkFramesLeft = 5;
|
||||
}
|
||||
|
||||
const Gamebuino_Meta::SaveDefault saveDefault[] =
|
||||
{ { 0, SAVETYPE_BLOB, SFG_SAVE_SIZE, 0 } };
|
||||
|
||||
@ -63,6 +70,17 @@ int8_t SFG_keyPressed(uint8_t key)
|
||||
return gb.buttons.timeHeld(button) > 0;
|
||||
}
|
||||
|
||||
void SFG_processEvent(uint8_t event, uint8_t value)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case SFG_EVENT_LEVEL_STARTS: blinkLED(BLUE); break;
|
||||
case SFG_EVENT_PLAYER_HURT: blinkLED(RED); break;
|
||||
case SFG_EVENT_LEVEL_WON: blinkLED(YELLOW); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
void SFG_getMouseOffset(int16_t *x, int16_t *y)
|
||||
{
|
||||
}
|
||||
@ -118,6 +136,7 @@ void setup()
|
||||
}
|
||||
|
||||
SFG_init();
|
||||
blinkLED(RED);
|
||||
}
|
||||
|
||||
void loop()
|
||||
@ -126,5 +145,16 @@ void loop()
|
||||
{
|
||||
}
|
||||
|
||||
SFG_mainLoopBody();
|
||||
if (blinkFramesLeft != 0)
|
||||
{
|
||||
if (blinkFramesLeft == 1)
|
||||
gb.lights.clear();
|
||||
|
||||
blinkFramesLeft--;
|
||||
}
|
||||
|
||||
SFG_mainLoopBody();
|
||||
|
||||
gb.display.setCursor(1,1);
|
||||
gb.display.print(gb.getCpuLoad());
|
||||
}
|
||||
|
@ -105,7 +105,7 @@
|
||||
CPU performance and memory).
|
||||
*/
|
||||
#ifndef SFG_DITHERED_SHADOW
|
||||
#define SFG_DITHERED_SHADOW 1
|
||||
#define SFG_DITHERED_SHADOW 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -135,7 +135,7 @@
|
||||
/**
|
||||
How many times rendering should be subsampled horizontally. Bigger number
|
||||
can significantly improve performance (by casting fewer rays), but can look
|
||||
a little worse.
|
||||
a little worse. This number should be a divisor of SFG_SCREEN_RESOLUTION_X!
|
||||
*/
|
||||
#ifndef SFG_RAYCASTING_SUBSAMPLE
|
||||
#define SFG_RAYCASTING_SUBSAMPLE 1
|
||||
|
Loading…
Reference in New Issue
Block a user