Sunday, December 20, 2009

ViruZ - fifth rewrite

Some of you might have heard ViruZ before, but I doubt you will remember it.
I posted about it when I still wrote in German.

So, it was a flash-game before. It's about viruses you have to kill with an antidote.
The viruses are represented with circles and you can inject the antidote with a mouse-click on the cursor-position. The viruses move around randomly.
On injecting the antidote, the viruses in a set area around that spot will be infected and become sick. Some may survive, some may die. Any viruses, that are near enough on sick viruses, will get sick themselves.

I had a flash-version going, then attempted to rewrite that with proper use of OOP, but I ran into some complications with my C++-way of thinking.
After that I attempted to rewrite it in C++ using Qt. I also had some problems due to being new to Qt, but now, on my forth rewrite, I got around them.
Sadly Qt seems to be too slow. It draws 50 viruses at around 3 FPS. I am using vector-graphics, but they should be hardware-accelerated and I'm using caching, so it's probably the loop. They are saved in a stack-allocated array, so it's probably just to big.
Well, Qt is meant to be used for GUIs, not really games.

I'd use threads to batch-process the movement and maybe try to coordinate batched drawing, but Qt seems to be limited in its threading-ability.

So I am looking into cairo atm. I've already managed getting zlib and libpng to build, but I'm kinda clueless about cairo. fmake doesn't seem to work, so I'll try downloading MSYS.

No comments: