Dark Bit Factory & Gravity

PROGRAMMING => General coding questions => Topic started by: va!n on December 05, 2021

Title: How to fix this floor casting bug?
Post by: va!n on December 05, 2021
hi guys,
i am trying to code something that looks like a smooth scrolling floor-casting effect (just only horizinal stripes).
seems i have problems with the mod operator and atm no idea, how to calculate the correct rect-high (should be smaller, yet more far away from the eye)
any idea, how to solve this problem? thanks

Code: [Select]
// t == timer

for (int i = 7; i > 0; --i)
    drawRect( 0, 60+pow(i,2) - t*9 % 10, 150, i )
Title: Re: How to fix this floor casting bug?
Post by: va!n on December 14, 2021
i changed the idea a bit, so i finally created and released this 140 char DWITTER entry...

https://www.dwitter.net/d/24500

Title: Re: How to fix this floor casting bug?
Post by: Shockwave on May 15, 2023
That looks quite effective.
Title: Re: How to fix this floor casting bug?
Post by: va!n on June 03, 2023
thanks