Brutus2D
« Shadow casting demo »

Welcome Guest. Please Login or Register.
Feb 9, 2010, 8:46am




Brutus2D :: Brutus2D :: ShowCase :: Shadow casting demo
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Shadow casting demo (Read 468 times)
u9
God
*****
member is offline

[avatar]

"...there's plenty of Sid to go around" - Ice Age


[homepage]

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.

If you are interested in how these classes work, check out the source code and maybe the Brutus2D Resource page at gamedesign.wikidot.com.

There are a few things missing before this can be called a game. Feel free to implement them :D

[image]

downloads
First release
ShadowDemo v01 (~405kB including exe)

Added health, collision detection etc.
ShadowDemo v02 (~482kB including exe)

Enemy now aims and fires when you come out from cover
ShadowDemo v03 (~460kB including exe)
« Last Edit: Nov 30, 2007, 5:50pm by u9 »Link to Post - Back to Top  IP: Logged

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
Guilect
Administrator
*****
member is offline




[homepage]

Joined: May 2005
Posts: 854
 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 ;)
« Last Edit: Nov 26, 2007, 8:37am by Guilect »Link to Post - Back to Top  IP: Logged
u9
God
*****
member is offline

[avatar]

"...there's plenty of Sid to go around" - Ice Age


[homepage]

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.

Check first post for download (including exe)

« Last Edit: Nov 29, 2007, 6:23pm by u9 »Link to Post - Back to Top  IP: Logged

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
u9
God
*****
member is offline

[avatar]

"...there's plenty of Sid to go around" - Ice Age


[homepage]

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?

:)

Check the first post for download.
Link to Post - Back to Top  IP: Logged

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
   [Search This Thread][Send Topic To Friend] [Print]

Google
Web brutus2d.proboards44.com
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!