Nothing crucial here but I wanted to comment on something that became apparent while I was working on a game or, more specifically, the level creation portion of the game. Someone may be able to give me some advice, however, on a better approach to take.
My game is structured on a set of classes I've created that wrap the Dark GDK 2D functions, sprites and images. I've done bitmap too but have managed for the most part to transfer the bitmap capabilities to my Image class. AAR....
My level creation has a panel on the right side over which I display 60 sprites that I can drag and drop into a grid on the left side. Although I'd drawn the grid I hadn't really developed the map for the grid. A couple of days ago I designed and declared the grid map, which is composed of Capsules, a child of my Sprite class. The grid is 11 by 20, or 220 Capsules. What a revelation. My program, which had been running at 60 FPS slowed down to 40 FPS.
This is with little in the way of computation taking place during idle times. The only thing I had going on was a moving ball and a paddle that cruises the bottom of the screen. None of the Sprites/Capsules had a valid image applied to them although a number for the sprite itself was assigned and a dbSprite () was issued. This morning I added a function to my Sprite class that allows me to Invalidate() it by making sure that the DGDK system doesn't track a number for it. With this in place for all empty grid positions my FPS jumped back up to 60.
What I've come to realize is that DGDK needing to track 280+ sprites, even though they're not even visible, seems to consume a considerable amount of CPU power. Most importantly to me is that the interactivity between images and sprites creates considerable confusion with my class now.
My feeling now is that I need to create a Sprite object under an invalid flag, without trying to assign an image to it on creation (or at least as a polymorphic option) and assign an image as a separate function then validating the two.
Note: While checking my facts and trying some new approaches I think I'm closing in on making this work. What I'd like would be some opinions as to what makes a sprite valid and how to create one in the GDK without having to set a position while hiding it at the same time.
Lilith, Night Butterfly
I'm not a programmer but I play one in the office