XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

light and collison questions for a 2D Tile game

Last post 07-21-2008 2:54 AM by dylanblack. 1 replies.
  • 07-20-2008 3:26 PM

    light and collison questions for a 2D Tile game

    hi all

    light-question:

    how can you make light effects in a 2D tile game?

    for example you have a little guy running in a cave with a candle in the hand.... not static candles at the wall...  moving ones...

    the cave is dark.. only there where the guys is you see something..

    how can i do this?

     

    collision question:

    is it posible that i check collisions only of a part of a tile.. example: i have a stone and out of the stone some lances are coming .. but i want only collision detection with the stone.. if the arrows hit the little guy, it just should be begin to jitter...

    or do i have to make two tiles.. one for the stone and one for the lances....

     

     

    thanks

     

  • 07-21-2008 2:54 AM In reply to

    Re: light and collison questions for a 2D Tile game

    There's a very good 2D dynamic light & shadow sample here:

    http://www.catalinzima.com/?p=323

    As for handling collisions, you could use a method similar to the one described in this article:

    http://dotnet.sys-con.com/read/589769.htm

    where you could have a separate texture that corresponds to your stone and lance texture, but has the lances in one colour and the stone in another colour, and you can check the colour of the pixel that the player touches to determine which part they have hit.

     


    www.dylanblack.com - XNA Game Dev Blog
Page 1 of 1 (2 items) Previous Next