Chomper Stomping
jQuery/JavaScript/CSS 3/HTML 5, Java/PHP/Python/ActionScript, Git, Chrome/Firefox Extensions, Wordpress/Game/iPhone App Development and other random techie tidbits I've collected



video games

September 13, 2007

Objects

More articles by »
Written by: Christopher McCulloh

To keep anyone who cares up to date on the status of the side-scroller:

I began mapping my objects out today.

My focus at this point is on the actors on my stage. That’s hazards, creatures and the player. This needs a lot of work, and I don’t have all the methods and fields down pat yet. What I’m really focusing on right now is figuring out what is shared between all objects and how they all relate to eachother.

I’ve temporarily made the decision to distinguish against creatures and hazards. At first I had them the same, but when I thought about it, a spike that comes out of the floor isn’t really a creature, and I probably don’t want it to be destroyable at this point. Sure, I *could* give the player the ability to get a “welding” power-up to slice through that metal spike, but I don’t at this point for-see that.

I’m thinking that I’m going to be testing collision first against hazards, and then against creatures. I don’t think I want the bad guys to be able to “hit” eachother, so I won’t test them against eachother (which will speed the game up), but I might want them to be obstructed or effected by hazards, so it will be good that I store them separately.

I went with interfaces for “move-able”, “destroy-able” and “damaging” because hazards and creatures both share these properties.

So what’s next? Well, I still need to flesh all of this out, and then I need to start on the actual “environment”. This will include doors, secret doors, walls, floors, ceilings. I think the whole thing may be “tile” based. I’m not actually sure at this point what my other options are, but we’ll see.

Problems? Collision detection for one. I don’t like “bounding boxes” especially because you are a circle, and it will be very frustrating if you get hurt when you aren’t even hitting something or (if I shrink the box) don’t get hurt if you do hit something. Of course other methods are extremely slow, but I’ll continue looking more into them. I might combine the bounding box method with another method so that you do the “slow” method -only- if the bounding box test comes back positive (If you don’t know what a bounding box is, that’s ok, I plan on making a very detailed post of my solution in the future. It’ll make it all clear then).

Also… slopes… If I’m doing tiling, those are squares. How will I have a sloped surface? I know I could theoretically make a sloped tile, but then how do you quickly do collision detection against that? Again, might have to do the whole bounding box, then slow method for this one.

I need to look around and see how other people address all of this…



About the Author

Christopher McCulloh
E-Commerce developer at Finish Line Co-Author of HTML, XHTML and CSS All-in-one Desk Reference for Dummies Graduated from IU with a Bachelors of Media Arts and Science and a Certificate in Applied Computer Science. Tech Editor for Building Facebook Applications for Dummies and Building Websites All-in-one for Dummies 2nd Edition. Creator and maintainer of the Status-bar Calculator Firefox Extension Three years professional experience in Java E-Commerce Development and four years professional experience with PHP for a combined total of seven years professional JavaScript/HTML/CSS experience




 
 

 
Screen Shot 2012-05-02 at 10.23.54 AM

Douglas Crockford – JavaScript the Good Parts

Really good lecture on JavaScript, especially if you are new to the language from another language like Java.
by Christopher McCulloh
0

 
 
cloudwars

Let the Cloud Wars Begin!!!

This is all going the same direction. They are all going to end up with unlimited storage for the same price point per year, so, the sooner one of them calls it and just offers that, the better that one will do. They need to ju...
by Christopher McCulloh
0

 
 
logo

dynode Batch Get Item

Working a lot with node.js, dynode and dynamoDB recently. Still trying to wrap my head around it all. Had a horrible time getting dynode.batchGetItem to work. Here is the error I was getting: { name: 'AmazonError', type: 'Valid...
by Christopher McCulloh
0

 

 
mysqlerror

WP phpBB Bridge: Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given

Warning: mysql_set_charset() expects parameter 2 to be resource, boolean given in wp-content/plugins/wp-phpbb-bridge/inc/widgets/wpbb_topics_widget.php on line 149 This is an error caused by the fact that the WP phpBB Bridge pl...
by Christopher McCulloh
0

 
 
 

Events Calendar Pro Nav Formatting Messed up on Empty Calendar

The Events Calendar Pro (from http://tri.be/) has a few problems. If you are trying to figure out why a calendar with no events in that month has completely screwed up header navigation, just put this line of code inside of tab...
by Christopher McCulloh
5

 




0 Comments


Be the first to comment!


Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>