Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 5801

new projects in development: games • Re: Lady Bug

$
0
0
I remember reading through posts (I think it was the high score challenge) that a few people had issues with the enemies catching up with ladybug at corners and it got me thinking

Currently the collision logic is

Code:

if (abs(enemyX - ladybugX) < ladybugEnemyRange)andif (abs(enemyY - ladybugY) < ladyBugEnemyRange)thenladybugKill
But maybe this would be better ?

Code:

if (ladybugX = enemyX) and if (abs(enemyY - ladybugY) < ladyBugEnemyRange)orif (ladybugY = enemyY) and if (abs(enemyX - ladybugX) < ladybugEnemyRange)thenladybugKill
I'm testing this in my head and as far as I can see this will allow the collision test when ladybug and the enemy are on the same row or column but should completely disable collisions at corners

I'll write the code and see what happens :rofl:

Statistics: Posted by lovebug — Tue Mar 11, 2025 1:27 am



Viewing all articles
Browse latest Browse all 5801

Trending Articles