Well I did reinvent the wheel , and it took about a day. Here is "The Nifty Sprite Class" for anyone who wants to download it, it can be located on my site:
http://www.zianet.com/codejoy/
at:
http://www.zianet.com/codejoy/NSprite.h
http://www.zianet.com/codejoy/NSprite.cpp
It is based on Andre LaMothe's TWGPG BOB Stuff, but I upgraded it to make it class and did things a bit different in some rare instances. Its currently V1.0 I look forward to hearing (god i hope someone finds this useful) from anyone who uses it and has suggestsions on making it better and points out bugs etc..
Thank you, enjoy, this is the first time I have ever posted code for others...(first time I did anything I deemed useful enough to post :) )
-Shane Thomas
codejoy@yahoo.com
Hmm, you upgraded a pre-existing wheel eh?
LOL yep I sure did. You had a point by how long it would take me to find what i needed. The bob engine is effective, and quite easy to use (at least to me) so why not port it over i figured. The idea you gave me for bouncing the rects along as offset for frames of anim was a good one, sometimes I really have a big problem of over thinking things.
Thanks,
Shane
Im glad to help anytime. Most of the people here at pocket matrix share ideas fairly freely.
I believe its one of things that makes someone a great computer scientist.
Codejoy wrote:It is based on Andre LaMothe's TWGPG BOB Stuff
Andre' LaMothe is one insane dude! I've read some of his books and there are simply awesome.
There, I said it (again)!
--Eric
Yeh I like his books alot too Eric.
Very handy little class. I'll have to delve into more later, but so far this looks to encapsulate 2 or 3 of my seperate classes in my own sprite engine while being only slightly more complex then any one of them.
Well I have a not yet so robust particle engine working too, I have to add some features. (of which im not sure how to do like using bmp's for the particles instead of just pixels, but thats on its way). So I decided I will probably get the NSprite and NParticles ready to roll into my own game engine (never though id do this) called:
"The Nifty Engine" why not.
So I have decided the feature set for this engine will be:
NSprite
NParticles
Perhaps some 3d stuff
NScroll <-- Have to figure out how to do this, I suspect it will be a wrapper for the tile engine stuff that gapidraw 2.04 seems to have (after just running the tile demo.
NSound <-- some sort of sound and music
NPhysics <-- A physics class?
What else I need? not sure...
Anything else anyone can think of? I have never really made even a 2d engine, I have always hacked other engines for my own use (to save time)..but since im getting tired of working on the games themselves (having to do ALL the design, ALL the art, ALL the sound fx etc.. etc..). I finally decided to take some time off and work on an engine for once that is mostly of my own making (Even though there are some rehashed parts LaMothe's books).
Oh well thats the plan anyway...
Anyone have links on a good engine design (been using Engine Enginuity articles on gamedev.net) though I will say I think developing a PPC 2d game engine is just a hair different...
-Shane
- Code:
// test if this is a clone
if (this->attr && SPRITE_ATTR_CLONE)
Shouldn't that be a binary AND? If that is the only attribute then that is why it still works.
Dan East
Yeah, there are other attributes. So that would cause a memory leak for any sprite with a non-zero attribute.
Dan East
The sound and scroll thing have largly been taken care of, you can still try if you like though.
Hekkus is a very nice soundsystem and its free, all you have to do is tell him your using it in your project just like GapiDraw.
Also, the hardest(which is fairly trivial) part of writing something that scrolls tiles is the clipping, and that is now taken care of in gapidraw.
Though, if you coupled the tile engine with some physics code such as collisions and such, then I say go for it.