Please test and try it. I need your comment, bad or good, anything you like to say.
Attachments:
Posted on 2005-08-07 01:11:28 by realvampire
Do NOT use  WM_KEYDOWN to move the player. Save the state of the needed keys and use it to move. On WM_KEYDOWN set a key variable to on, on WM_KEYUP set it to off, and on each frame move the player according to that variable.
Just like I thought, your black'n'white bitmask is bad - it must be only black and white, no gray shades in between. Move the player over a "house" (as you called it) and the player sprite will glow in red, in an ugly way.
Posted on 2005-08-07 08:45:58 by Ultrano

Do NOT use? WM_KEYDOWN to move the player. Save the state of the needed keys and use it to move. On WM_KEYDOWN set a key variable to on, on WM_KEYUP set it to off, and on each frame move the player according to that variable.
Just like I thought, your black'n'white bitmask is bad - it must be only black and white, no gray shades in between. Move the player over a "house" (as you called it) and the player sprite will glow in red, in an ugly way.


Amazing. You know that mistake until the bit part. :U I will re render it. It is because of the anti aliasing.
Posted on 2005-08-07 10:02:34 by realvampire
With GIMP you can easily fix/remake the masks. Fixing is done via threshold, remaking - via color/solid areas selection. You having mixed the masks and color-bitmaps makes it a bit harder, though.
Posted on 2005-08-07 10:34:23 by Ultrano
For the input, you need two dd vars: "keys" (currently pressed keys) and "newkeys" (keys that were pressed just now, that were calm on the previous frame). Also, a bitmask to allow/disallow input on specific keys.

Now, your next step is to make the bulllets manager and particles manager.
They're both very similar, with the exception that bullets will be testing for collission, and have a flag for ownership (player/enemy). Splitting the bullets in two different arrays will be even better. I strongly suggest using any kind of OOP for entities. And I mean _any_ . Virtual functions/methods will save you a lot of time and brainstorming - and they're easy to make even without any special framework like OA32.
Posted on 2005-08-07 10:45:33 by Ultrano
It doesn't start. Just uses 100% of the CPU and keeps growing. It grew to 100MB in about 3 minutes, so i killed the process.
Posted on 2005-08-07 14:31:00 by ti_mo_n

It doesn't start. Just uses 100% of the CPU and keeps growing. It grew to 100MB in about 3 minutes, so i killed the process.


It is because you lost one or more of the sprite. Extract everything well and it will work.
Posted on 2005-08-08 00:47:56 by realvampire
#####################################################
Testing archive: MyGame.zip -- 2005-08-09 01:24? (GMT+1)
#####################################################

Testing: MyGame\Grafik_engine.exe
Testing: MyGame\Img\BlowPic.bmp
Testing: MyGame\Img\BlowPicBmp.bmp
Testing: MyGame\Img\F16PicAll.bmp
Testing: MyGame\Img\Fire.bmp
Testing: MyGame\Img\FireMask.bmp
Testing: MyGame\Img\House\BuildingBitmap0.bmp
Testing: MyGame\Img\House\BuildingBitmap1.bmp
Testing: MyGame\Img\House\BuildingBitmap2.bmp
Testing: MyGame\Img\House\BuildingBitmap3.bmp
Testing: MyGame\Img\House\BuildingMask0.bmp
Testing: MyGame\Img\House\BuildingMask1.bmp
Testing: MyGame\Img\House\BuildingMask2.bmp
Testing: MyGame\Img\House\BuildingMask3.bmp
Testing: MyGame\Img\House\HouseBitmap0.bmp
Testing: MyGame\Img\House\HouseBitmap1.bmp
Testing: MyGame\Img\House\HouseBitmap2.bmp
Testing: MyGame\Img\House\HouseBitmap3.bmp
Testing: MyGame\Img\House\HouseMask0.bmp
Testing: MyGame\Img\House\HouseMask1.bmp
Testing: MyGame\Img\House\HouseMask2.bmp
Testing: MyGame\Img\House\HouseMask3.bmp
Testing: MyGame\Img\House\Thumbs.db
Testing: MyGame\Img\Licence.txt
Testing: MyGame\Img\OptionBitmap.jpg
Testing: MyGame\Img\OptionBitmap2.jpg
Testing: MyGame\Img\OptionBitmapMask.jpg
Testing: MyGame\Img\OptionBitmapMask2.JPG
Testing: MyGame\Img\Sand.bmp
Testing: MyGame\Img\StarPicAll.bmp
Testing: MyGame\Img\StarPicALL.JPG
Testing: MyGame\Img\StealthPicAll.bmp
Testing: MyGame\Img\X29PicAll.bmp
Testing: MyGame\Sound\Bomb.wav
Testing: MyGame\Sound\Butoden2.mid
Testing: MyGame\Sound\Credit.txt
Testing: MyGame\Sound\explosion.wav
Testing: MyGame\Sound\Plasma.wav

#####################################################
Done. -- 2005-08-09 01:24
There were no errors in the archive: MyGame.zip


It ectracts 38 files AND doesn't start.

/edit

My system:
Pentium 4 2.4GHz
1024 MB RAM
GeForce FX 5200
Windows XP SP2
Posted on 2005-08-08 18:28:33 by ti_mo_n
Crashed my system as well:

Windows 2000 SP4
AthlonXP 1900
Radeon 9100 128MB
768MB ram
Posted on 2005-08-09 20:04:46 by x86asm
It eats my ram like its got munchies.. and it doesnt move when i try and play
Posted on 2005-08-10 13:48:07 by g3nuin3
It crashed my laptop too.

T23 Thinkpad
P3 1.13Ghz
512MB ram
S3 SuperSavage 16MB


LEt me know if I can help :D
Posted on 2005-08-10 16:19:26 by x86asm
x86 thanks I will need that  ;) .


The memory seems invalid. I think it is because I did use only GMEM_ZEROINIT and not with GMEM_FIXED.
Here is the version that use GMEM_ZEROINIT or GMEM_FIXED. If it still crashed, I'll open the source and give it to you.
Attachments:
Posted on 2005-08-10 19:47:34 by realvampire
this one isn't working either, realvamp.- but from the pictures
I can tell I would like to see it. keep going...

used Windows 2k SP4
Posted on 2005-08-11 00:12:56 by Dom
I have made  the keyboard map. And I remove all the sound. To whoever want the source tell me your active email.

It seems my program always crash on SP2 or above system.  On a hardware with 1024MB RAM it crash too. From all the user report my conclusion is end at wrong management memory or incompatible function of memory.

How do you allocate a memory?
Attachments:
Posted on 2005-08-11 07:11:25 by realvampire
memory allocation has been discussed a lot, and the definite conclusion is to use HeapAlloc. I even tried to make a specialized faster than HAlloc manager - yet it was slower.
I use the attached code as a lib, it NEVER failed me.
Attachments:
Posted on 2005-08-11 08:02:23 by Ultrano
The new version crashed on my PC as well. I will use the source and debug what is happening either tomorrow or the day after.
Posted on 2005-08-11 16:43:02 by x86asm
The animation is a bit choppy - what framerate is it ? Seems around 16fps. Should be 24+ fps :)

Also, while I don't forget - bear in mind that sooner or later you'll need to have a WorldBuilder, an Enemy Manager, and an enemy-script. Bosses could need special handling, too - depending on many things. The WorldBuilder is the hardest to code, the enemy manager is the hardest to design for (artwork), the enemy-script is the hardest to make up (for each stage). Optimistically stated, the world builder is the easiest to design for/with, the enemy manager is most fun to code, and the enemy script is the easiest to code :)
Posted on 2005-08-11 17:35:54 by Ultrano
Thanks. I will use heapalloc and made a website for this game.

Ultrano, I saw on your malloc function it only have one HEAP1 variable. What will be happen if I use it multiple time? Will something bad happen? Memory leaking or something?
Posted on 2005-08-12 05:05:36 by realvampire

The animation is a bit choppy - what framerate is it ? Seems around 16fps. Should be 24+ fps :)

Also, while I don't forget - bear in mind that sooner or later you'll need to have a WorldBuilder, an Enemy Manager, and an enemy-script. Bosses could need special handling, too - depending on many things. The WorldBuilder is the hardest to code, the enemy manager is the hardest to design for (artwork), the enemy-script is the hardest to make up (for each stage). Optimistically stated, the world builder is the easiest to design for/with, the enemy manager is most fun to code, and the enemy script is the easiest to code :)


Which version is running on your computer and what system do you use?
The Frame rate is 30. If it slower on your system it is I dont know. The CPU Usage is about 20% on 2.4 Ghz computer and 30% on 1.7 Ghz computer.
Posted on 2005-08-12 05:26:34 by realvampire

The new version crashed on my PC as well. I will use the source and debug what is happening either tomorrow or the day after.


I send it to isaac_8e@hotmail.com <isaac_8e@hotmail.com>
Posted on 2005-08-12 05:28:29 by realvampire