Our Feed

feed-image RSS Feed
Funplosion Labs - XNA games and resources
Cavemen Print
User Rating: / 42
PoorBest 
Written by Xuro   
Friday, 02 April 2010 15:19
________________________________________

Have you ever had one of those days where everything is going fine, you're at peace with the world and whatnot... and then all of a sudden it hits you: WHAT DID CAVEMEN USE FOR TOILET PAPER?!?  ...I don't know if I'll be able to sleep tonight... 

Last Updated on Friday, 02 April 2010 15:53
 
Calculating Intersect Points Print
User Rating: / 3
PoorBest 
Written by Xuro   
Wednesday, 31 March 2010 13:20

A visitor to my site (Hi Jay!) recently made use of my sample code for detecting the intersection between a point and a line segment, and was inquiring about how to calculate the precise point(s) of intersection between a circle and a line.  Naturally, I thought that would make a good topic for a new post.  :D

 

In general, the math to calculate intersection points involves using what you know about the objects in question (XY points, radii, etc) to derive equations representing the objects, and then solve the system of equations to identify the precise points where the objects intersect.  I'm familiar (albeit a bit rusty) with the math but have never done it in code so I felt it would be an interesting thing to play around with.  However, as sometimes happens, while researching to make sure there wasn't a better way or a built-in function or whatnot in C#, I came across an excellent article at blog.csharphelper.com about this precise question - it's in C#, has a downloadable sample and everything.  Beyond that, the site has a number of other interesting posts so rather than reinventing the wheel I wanted to share this resource with all of you.  

 

Last Updated on Wednesday, 31 March 2010 16:50
 
Pixel Shader Shockwave Print
User Rating: / 4
PoorBest 
Written by Xuro   
Thursday, 25 March 2010 02:32

Pixel Shaders are awesome!  I've been playing with Pixel Shaders lately... went through the excellent Custom Shader tutorial in the XNA Developer Talk series, and then did some experimenting of my own trying to make a respectable shockwave effect.  My shockwave effect went through several iterations:

1) Stationary effect controlled by a texture (a radial gradient)

2) A programmatically-generated effect in the effect file

3) A programmatically-generated effect that is controlled in my code, with several key variables passed in to the effect file (XY location, distance to shockwave from origin, and width of shockwave)

4) An array of shockwaveParam objects passed into the effect file and applied to the image.

Very fun stuff to experiment with :) Here's a screenshot showing number four in action:

shadertest

Last Updated on Thursday, 25 March 2010 23:21
 
Improving on notepad: TextPad Print
User Rating: / 1
PoorBest 
Written by Xuro   
Thursday, 11 March 2010 12:30

I tend to use notepad a lot... for me it's the digital equivalent of jotting down notes on scrap paper.  A couple things I like about it are that it has a very minimalist interface which leaves the maximum amount of space for text, and there are no worries about it being a resource hog.  However, I've been burned more than once by an untimely machine crash causing me to lose my current notes because it had been a while since I had saved.  Enter TextPad.  Like the built-in windows text editor, notepad, TextPad is a slim text editor but it adds on a few key features that come in very handy without turning into bloatware.  From the perspective of XNA game development, my favorite features are:

1) Auto-save

2) C# syntax highlighting

Below I've listed the steps I always take with a new TextPad install in order to set it up as a minimal "notepad+".  

Last Updated on Thursday, 11 March 2010 17:30
 
Fair Use in the context of video games Print
User Rating: / 4
PoorBest 
Written by Xuro   
Monday, 08 March 2010 12:30

I have recently heard some people haphazardly claiming that their use of other people's graphics and/or music in their game was ok due to "Fair Use".  Typical arguments:

"I'm not making a profit, so it's fair use."

"I'm only using a few images, so it's fair use."

Last Updated on Saturday, 27 March 2010 15:22
 
Collision Detection: Line vs Point, Circle and Rectangle Print
User Rating: / 7
PoorBest 
Written by Xuro   
Thursday, 04 March 2010 02:47

I recently needed to refresh my math a bit in order to detect the intersection of a line and a rectangle, or a line and a point.  For everything so far, I had been using rectangular bounding boxes and simply using the standard built-in Rectangle .Intersects() functionality:

if (bullets[i].Rect.Intersects(zombie.Rect))
{
zombie.alive = false;
bullets[i].alive = false;
player1.score += 1;
//chance for ammo drop
bool dropAmmo = (random.NextDouble() > 0.9);
if (dropAmmo)
{
SpawnPickupable(zombie.position, Vector2.Zero, PickupableType.Ammo);
}
break;
}

 

if (bullets[i].Rect.Intersects(enemy.Rect))                          
{                                
  enemy.alive = false;                                
  bullets[i].alive = false;                              
  //...
}

 

This worked well, but with a new laser weapon I wanted to test for the collision between a line and a rectangle.  I didn't need pixel-perfect collision, so I ended up going with using line-point collision as an approximation.  In a nutshell, I do this:

Given a line segment AB, and a point p...

A) Find the point on the line segment nearest to the point p

B) Calculate the distance between the nearest point and p

C) Compare the distance between the points to a collision threshold distance, and if point p is closer to the line than that threshold distance I count it as a collision and react accordingly.  

Last Updated on Thursday, 04 March 2010 02:46
 
Adding the Whoa (and rekindling motivation) Print
Written by Xuro   
Monday, 01 March 2010 13:00
"For the prototype aim low and iterate quickly, but don't be afraid to slow down and add the whoa."

Last Updated on Tuesday, 02 March 2010 18:25
 
Big Update to the Free Game Assets article Print
Written by Xuro   
Friday, 26 February 2010 23:00

I've finished the research I had been working on: scrubbing the web for some quality sites to find free music and sound effects for XNA game development.  

 

Similar to what I encountered when looking for free sprites and tilesets, many of the sites out there are of dubious legality.  Luckily, however, there are places with legitimate free content that can be used in commercial games and I've updated my Free Game Assets article with the quality free audio I found.  Each listing in the article indicates whether the site has music and/or sound effects, includes a brief summary of the site, and contains links to the free content as well as a direct link to the site's licensing page when possible.

 

Hope you find the information useful!

Last Updated on Tuesday, 02 March 2010 22:43
 
<< Start < Prev 1 2 Next > End >>

Page 1 of 2
Friday, 18. April 2014

Design by: LernVid.com