mirror of
https://github.com/TomHarte/CLK.git
synced 2024-08-16 16:28:59 +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:
parent
d1dbf8c21f
commit
36396b3d62
@ -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
|
// TODO: implement this correctly; should be triggered by player counter hitting the appropriate point, and
|
||||||
// use additional storage position for enabled
|
// use additional storage position for enabled
|
||||||
if(lock)
|
if(missile_[missile].locked_to_player && !lock) missile_[missile].position = player_[missile].position + 1 + 16/player_[missile].adder;
|
||||||
{
|
missile_[missile].locked_to_player = lock;
|
||||||
missile_[missile].enabled = false;
|
|
||||||
missile_[missile].position = player_[missile].position + 5;
|
|
||||||
// printf("%d", missile);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
missile_[missile].enabled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TIA::set_missile_motion(int missile, uint8_t motion)
|
void TIA::set_missile_motion(int missile, uint8_t motion)
|
||||||
|
@ -227,12 +227,13 @@ class TIA {
|
|||||||
// missile state
|
// missile state
|
||||||
struct Missile: public HorizontalRun {
|
struct Missile: public HorizontalRun {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
|
bool locked_to_player;
|
||||||
int copy_flags;
|
int copy_flags;
|
||||||
|
|
||||||
inline void draw_pixels(uint8_t *const target, const int count, const uint8_t collision_identity)
|
inline void draw_pixels(uint8_t *const target, const int count, const uint8_t collision_identity)
|
||||||
{
|
{
|
||||||
if(!pixel_position) return;
|
if(!pixel_position) return;
|
||||||
if(enabled)
|
if(enabled && !locked_to_player)
|
||||||
{
|
{
|
||||||
HorizontalRun::draw_pixels(target, count, collision_identity);
|
HorizontalRun::draw_pixels(target, count, collision_identity);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user