2D Java Game Engine #14 : Shadows

preview_player
Показать описание
Finally add in shadows to the lighting.
Рекомендации по теме
Комментарии
Автор

Had to say that even though this is a five years old video this is really amazing.

LRcraft
Автор

Really happy to see you back :D, I'm a veteran from your old channel

ICTitans
Автор

Having the y loop first is only more efficient when you do it like this:

int yw=0;
for(int y=0;y<someValue;y++){yw = y*width;
for(int x=0;x<someOtherValue;x++){
someArray[x+yw]=value;
}
}

The reason this is more efficient is because you only multiply once for each y value, instead of every time. Also initializing the yw outside the loop, improves efficiency. Changing your loops to match this way will improve your frame rate quite a bit. Nice epesode by the way!

amilious
Автор

28:34 I'm having a problem. Throwing an error saying "Exception in thread "main"" pointing directly to the line of code:
if(lightBlock[screenX + screenY * pixelWidth] == Light.FULL)
return;

EDIT: Found the problem. I put:
lightBlock[screenX + screenX * pixelWidth]

when I should have put:
lightBlock[screenX + screenY * pixelWidth]

tylereldred
Автор

Bruh, my light is beautiful. But I have 4 frames per second. It is TERRIBLE.😂🤣🤣😂🤣😂🤣🤣😂🤣

Edit: Never mind, it's back at 60fps. Turns out I had maxRed printing in the console.

roninyasuo
Автор

My light is like a star or cross it has no radius any help ?

hazardousoriginations
Автор

For some reason image, does not show in front of image2. It is on the screen only when I no longer have image2. Any help?

danbesu
Автор

How to get a Light.PARTIAL Lightblock?

-winrecker-
Автор

the light nor my grey box appears, no errors

Hababa
Автор

My light is just a thin line on the y-axis. HELP.

colinryan
Автор

For some reason my cyan light isnt showing, but there are no errors occurring

MagTubeMr