Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Spooky Shadows [PlayBasic]

Author
Message
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 18th Jul 2009 03:35 Edited at: 8th Sep 2011 22:49
Spooky Shadows V0.01

This little example shows of how you can achieve a simple overhead light source with shadow effect. In the demo the mouse represents the light sources position. The hard environment is a vector world, there's no clipping, so the light source can move through the solid space.. Use the mouse button to change the light colour.


Demo Controls:

Mouse = Control Light Source
Mouse Button = Change Light Colour
ESC = EXIT DEMO




Download:

Spooky Shadows



Video



Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 19th Jul 2009 05:09 Edited at: 8th Sep 2011 22:48
Spooky Projectiles

Here's a little extension of the previous concept. This one renders some projectiles moving through the vector environment. The main difference to the previous example, is that each object has a light associated with it and is clipped to hard world. So you can fire down hallways and perhaps reveal a way though. The main character light has been removed so you can see this better. Will post a demo later.

Attachments

Login to view attachments
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 20th Jul 2009 09:27 Edited at: 8th Sep 2011 22:51
Spooky Shadows V0.03

This little update adds a stand in player in with firing (look familiar ). It uses the arrow keys for 8way digital movement and the mouse for targeting.. To dress it up, this time i've used a screen grab of Alien Breed with some quick vector mappings as the collision walls. So the lights & movement are clipped to whatever area you're in. That combined with some blurring of the light map and gives a better feel to the scene. Even though it's just thrown together.



Demo Controls:

Arrow Keys = Control Player (the circle thing )
Mouse = Aim
Mouse Button = Fire towards mouse
ESC = EXIT DEMO


Download:

Spooky Shadows V0.03




Attachments

Login to view attachments
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 20th Jul 2009 21:12
Nice effects there. It'd be nice to see this made into a full game.

Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 21st Jul 2009 06:29
Yeah, I wouldn't mind knocking this up into a bit of a game. Time & media permitting... We'll see.

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 21st Jul 2009 18:17
Pretty cool. Is the PB source code available for this?


So many games to code......so little time.
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Jul 2009 15:00
Quote: "Is the PB source code available for this?"


No, but it was largely cut and pasted together from two examples that you'll find in the Projects / Demos folder.

Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Jul 2009 15:02 Edited at: 8th Sep 2011 22:48
Spooky Shadows V0.04

This is another little update, this time adding some graphics for the player.


Demo Controls:

Arrow Keys = Control Player
Mouse = Aim
Mouse Button = Fire towards mouse
ESC = EXIT DEMO


Download:

Spooky Shadows V0.04



Video



LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 27th Jul 2009 17:48
Looks great. However, it looks like the shots are coming out at the wrong angle as compared to the gun.

Quote: "No, but it was largely cut and pasted together from two examples that you'll find in the Projects / Demos folder."

Thanks, I'll take a look.


So many games to code......so little time.
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 31st Jul 2009 04:56 Edited at: 31st Jul 2009 04:57
Very cool lighting effects! Is the sliding collision built in to PB? I've been getting more serious about 2D game dev and PB seems like a good option.

i like orange
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 31st Jul 2009 16:13
Yes PB has a great sliding collision set. You basically draw lines where you want your collision boundaries and use intersect rays for collision. Its very easy.
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 31st Jul 2009 16:50
Quote: "Yes PB has a great sliding collision set. You basically draw lines where you want your collision boundaries and use intersect rays for collision. Its very easy."


Sounds very useful! I'm going to have to look into PB after I'm done with my current project.

i like orange
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 31st Jul 2009 17:04
Ahh, I remember Kevin's old line intersection code, in fact I still use it for collision sometimes.

It's really quite usefull, not just for character collision but bullet collision and deflection too - I'm sure it can even return the exact collision point. I guess this must be fueling the shadow system as well, like projecting lines to each vertex from the light source.

It has a really nice look to it huh!, PlayBasic is one of those dark horses, full of usefull features you might not even consider until it's shown how neat and easy it can be.


Health, Ammo, and bacon and eggs!
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 2nd Aug 2009 22:47
I used the examples Kevin mentioned. The shadows are made using the ray intersect code. Shoot out the rays. Make a polygon shape using the vertices obtained from the ray intersects. Then use the blend image functions to overlay it all. I'm sure Kevin's code is more elegant than mine, but I'm pulling 200+ fps on a Dell M70 laptop.

It has inspired me to finish making a program in DBpro to make a bunch of top down sprites. I will take 3d models and render them in 2d. Then us PB to make a game.
Discan
14
Years of Service
User Offline
Joined: 5th Aug 2009
Location:
Posted: 6th Aug 2009 15:09
nice work
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 6th Aug 2009 23:35
WildBill,

Quote: "I used the examples Kevin mentioned. The shadows are made using the ray intersect code. Shoot out the rays. Make a polygon shape using the vertices obtained from the ray intersects. Then use the blend image functions to overlay it all."


Yeah, that's about all there is to it.. You'll have to show us your version..


Andrew,

Quote: " Is the sliding collision built in to PB? "


Yes, there's a few different methods built in. The most useful stuff is good old fashion ray intersection.



Van,

Quote: "Ahh, I remember Kevin's old line intersection code"


yeah, I remember that too, might be still on the DB code page at uw. The version built in PB is a little better than that

Login to post a reply

Server time is: 2024-04-23 20:15:52
Your offset time is: 2024-04-23 20:15:52