1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-10 12:29:01 +00:00

Made a slightly better, albeit still inaccurate, version of missile-player lock.Enough for Combat to do reasonable things.

This commit is contained in:
Thomas Harte 2017-02-21 20:45:20 -05:00
parent d1dbf8c21f
commit 36396b3d62
2 changed files with 4 additions and 11 deletions

View File

@ -355,16 +355,8 @@ void TIA::set_missile_position_to_player(int missile, bool lock)
{
// TODO: implement this correctly; should be triggered by player counter hitting the appropriate point, and
// use additional storage position for enabled
if(lock)
{
missile_[missile].enabled = false;
missile_[missile].position = player_[missile].position + 5;
// printf("%d", missile);
}
else
{
missile_[missile].enabled = true;
}
if(missile_[missile].locked_to_player && !lock) missile_[missile].position = player_[missile].position + 1 + 16/player_[missile].adder;
missile_[missile].locked_to_player = lock;
}
void TIA::set_missile_motion(int missile, uint8_t motion)

View File

@ -227,12 +227,13 @@ class TIA {
// missile state
struct Missile: public HorizontalRun {
bool enabled;
bool locked_to_player;
int copy_flags;
inline void draw_pixels(uint8_t *const target, const int count, const uint8_t collision_identity)
{
if(!pixel_position) return;
if(enabled)
if(enabled && !locked_to_player)
{
HorizontalRun::draw_pixels(target, count, collision_identity);
}