18 May 2015 @ 11:07 AM 

I’ve been, as I mentioned previously, fiddling with BASeBlock recently and I’ve find a few little gems that are worth sharing discussing here.

One of the effects of using GDI+ itself for drawing the game is that all physics and game logic has to be handled by the game. Unlike modern game development frameworks, we don’t get to take shortcuts for things like physics.

This made the creation of the “Polygon” Block a rather tall order, primarily because the math involved is rather advanced, In my opinion. But, I managed to get it working. I also make use of polygons for the purpose of block debris- when a block is destroyed, a number of random polygon debris “breaks” apart the block. I had some fun with that and some blocks break apart differently, such as the “Brick” block which attempts to mimick the classic Super Mario Brothers Brick breaking.

But that isn’t what this is about. One of the requirements of the standard debris (as I call it) is the creation of randomized polygons within a given range of sizes and number of points. These are randomized to prevent them appearing to “regular” since they are used for debris particles.

For generating the polygons themselves, I take a rather straightforward approach. Effectively with a chosen number of points, I use the same logic that is used to generate a regular polygon but I also vary the radius used for each point, which creates a polygon that looks very much arbitrary.

Relatively straightforward, to be honest. It does go to show that trigonometry certainly has uses.

Have something to say about this post? Comment!

Posted By: BC_Programming
Last Edit: 18 May 2015 @ 11:07 AM

EmailPermalink
Tags
Tags: , ,
Categories: .NET, C#


 

Responses to this post » (None)

 

Sorry, but comments are closed. Check out another post and speak up!

Tags
Comment Meta:
RSS Feed for comments

 Last 50 Posts
 Back
Change Theme...
  • Users » 47469
  • Posts/Pages » 388
  • Comments » 105

PP



    No Child Pages.

Windows optimization tips



    No Child Pages.

Soft. Picks



    No Child Pages.

VS Fixes



    No Child Pages.

PC Build 1: “FASTLORD”



    No Child Pages.