Projects > Game Development

Birds game

(1/4) > >>

caballero:
The game is done.

Full Masm 32 bits + GDI source code. No external dll or lib used. Everything used is in my web page freely downloable.

Some birds flying here and there shit in your garden. You have a ball to convince them to do it in the neighbor's garden.

You have a score account and a seconds counter. When this counter reaches zero it should be game over, it's on the to-do list.

The ball describes a parabola. If it hits a bird, it will increase the marker by more the farther away the bird is.

Known bug: After a few shots, the motion of the ball speeds up. [Fixed]

jj2007:
Looks lovely :thumbsup:

Wouldn't sky.png (4415 bytes) instead of sky.bmp (921654 bytes) be a better choice? Same for the birds, they could be one gif file...

Biterider:
Hi Caballero
Looks very good!
I'm looking forward to the finished game.  :thumbsup:

Biterider

caballero:
Hi, thank you for testing it.  :thumbsup:

I don't use any external routine to read image files, I read them "by hand" and bmp files are one of the easiest to read, that's why I use them. I think I could avoid to use the sky.bmp painting the cloudy sky with my own routines but, since the original challenge was reading these two files, I'll leave it at that.

jj2007:
For inspiration - with source ;-)


--- Code: ---GuiParas equ "Birds", w500, h320, b none
include \masm32\MasmBasic\Res\MbGui.asm
  SetGlobals SDWORD bird1X, bird1Y, bird2X, bird2Y, d1y, d2y
  mov eax, GuiHeight
  sar eax, 1
  sub eax, 30
  mov bird1Y, eax
  add eax, 60
  mov bird2Y, eax
Event Paint
  GuiImage "sky.png", fit
  GuiImage "tweety.gif", bird1X, bird1Y, 60, 60
  GuiImage "tweety.gif", bird2X, bird2Y
Event Timer
  sub bird1X, 5
  .if bird1X<-60
m2m bird1X, GuiWidth
  .endif
  sub bird2X, 4
  .if bird2X<-60
m2m bird2X, GuiWidth
  .endif
  sub Rand(11), 5
  add eax, d1y
  add bird1Y, eax
  .if bird1Y<20
dec d1y
  .elseif bird1Y>250
inc d1y
  .endif
  sar eax, 1
  inc eax
  .if bird2Y<20
dec d2y
  .elseif bird2Y>250
inc d2y
  .endif
  add eax, d2y
  sub bird2Y, eax
  GuiCls
GuiEnd
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version