Joined: Jun 2006 Gender: Male Posts: 569 Location: Faroe Islands
Shadow casting demo « Thread Started on Nov 25, 2007, 12:40pm »
I was playing around with casting shadows in a 2D game and turned up with this. The sun circulates around very slowly. Notice how the tank casts shadow on itself I did this by cutting the sprite into layers and rendering one layer at a time, first shadow, then object for each layer. You can see the images i used in the gfx folder.
I also used my Linked List library to keep a list of all the active explosions as well as a list of all the objects in the game and my GameMouse class for better control of the mouse input.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein) www.wirednerd.com
Re: Shadow casting demo « Reply #1 on Nov 26, 2007, 7:48am »
Good job U9. The shadows look nice. Note to others trying the demo: You do have to wait a while to notice the shadow position change relative to the rocks and tanks. For example the shadow on a rock might be to the left; wait a minute and you will see the shadow to the top. Wait another minute and the shadow is to the right now.
Maybe, just for a demo of the shadows, you could have a sun image show on the screen that moves and it might help to show where the light source is and where to look for the shadows.
P.S. the general concept of the tanks and rocks looks kind of familiar to me some how
Joined: Jun 2006 Gender: Male Posts: 569 Location: Faroe Islands
Re: Shadow casting demo « Reply #2 on Nov 29, 2007, 6:22pm »
Yeah, i should have shown the sun.
Anyways, i have updated the "game" so now there is collision detection when you fire and i also implemented damage. Still no AI or other player though.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein) www.wirednerd.com
Joined: Jun 2006 Gender: Male Posts: 569 Location: Faroe Islands
Re: Shadow casting demo « Reply #3 on Nov 30, 2007, 6:15pm »
I can't believe it. My first game against my new AI and i lost. I'm not sure why, she doesn't move. She just aims and fires at the right time. Aaaanyways, I have updated the game with some AI. It's about half done. Maybe someone could tell me how i should make it move around and use the rocks as cover from the player?
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein) www.wirednerd.com