1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-19 23:32:28 +00:00

Attempted properly to respect start.

This commit is contained in:
Thomas Harte 2017-02-11 08:26:09 -05:00
parent 64d5712d1d
commit 40d3f5f7f6

View File

@ -588,10 +588,8 @@ void TIA::draw_player(Player &player, CollisionType collision_identity, const in
// quick hack! // quick hack!
if(is_moving_[position_identity]) if(is_moving_[position_identity])
{ {
int motion = motion_[position_identity]; int motion = motion_[position_identity] ^ 8;
position += 8;
position += motion; position += motion;
if(motion&8) position -= 16;
is_moving_[position_identity] = false; is_moving_[position_identity] = false;
position = (position + 160)%160; position = (position + 160)%160;
} }
@ -599,7 +597,7 @@ void TIA::draw_player(Player &player, CollisionType collision_identity, const in
// check for initial trigger; player.position is guaranteed to be less than 160 so this is easy // check for initial trigger; player.position is guaranteed to be less than 160 so this is easy
if(player.graphic && position + length >= 160) if(player.graphic && position + length >= 160)
{ {
int trigger_position = 160 - position; int trigger_position = 160 - position + 6 + start - first_pixel_cycle;
int terminus = std::min(160, trigger_position+8); int terminus = std::min(160, trigger_position+8);
while(trigger_position < terminus) while(trigger_position < terminus)