flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > game

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
xpeter



Joined: 26 Mar 2009
Posts: 12
Location: Germany
xpeter 07 Apr 2009, 22:12
Hi,

update version of puzzle game is done.
The same rules as the old version.
You can type your name now.
Once you have written your name, press the return key !
With the Back Space key you can delete your name again, if
it would incorrect written.

best regards
Peter


Description:
Download
Filename: FullPuzzleGame.rar
Filesize: 320.01 KB
Downloaded: 1138 Time(s)

Description:
Download
Filename: Puzzle.rar
Filesize: 308.61 KB
Downloaded: 1060 Time(s)



Last edited by xpeter on 15 Apr 2009, 17:40; edited 2 times in total
Post 07 Apr 2009, 22:12
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 07 Apr 2009, 22:44
I liked it very much Very Happy Petty I can't play it for more time now Sad

Would be possible for you to upload the source code too?

Thanks and welcome Smile
Post 07 Apr 2009, 22:44
View user's profile Send private message Reply with quote
buzzkill



Joined: 15 Mar 2009
Posts: 111
Location: the nether lands
buzzkill 07 Apr 2009, 23:05
Looks very good xpeter, I just played it on linux under wine (works great, in case other linux users want to try it). Like LocoDelAssembly said, if you'd be willing to share the source, other people could learn from it. Maybe somebody could even help you write the high score table?

How long did it take you to write this? Did you learn assembly programming with fasm, or did you have prior experience? Anyway, great job Smile
Post 07 Apr 2009, 23:05
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 08 Apr 2009, 00:03
Looks nice, just a little slow action, and window placement should be in the middle of screen.

Nothing beats Supaplex, though...
Post 08 Apr 2009, 00:03
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 172
Location: Maryland, USA
rCX 08 Apr 2009, 01:38
Great work. It's a little difficult but fun Smile
Post 08 Apr 2009, 01:38
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1392
Location: Piraeus, Greece
Picnic 08 Apr 2009, 15:16
Looks very nice game xpeter congratulations.
Unfortunately it runs very slow on my machine and i can't enjoy it.
Post 08 Apr 2009, 15:16
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 08 Apr 2009, 17:32
On my machine its right in the middle of the screen. I've got 2003 Server, what have you got, vid?

The process runs too high I think. I wish to see the main loop, I guess there are no sleeps/waits there.

I'm very glad to see someone FINISH a project.

I am famous for starting many, but not finishing any Wink Sounds like a moto Razz
Post 08 Apr 2009, 17:32
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
xpeter



Joined: 26 Mar 2009
Posts: 12
Location: Germany
xpeter 08 Apr 2009, 18:01
Hi ,

the puzzle game has a delay from 16 msec's.
it runs very fine here on my computer ! [AMD ATHLON 300+].
i must still work on a adjustable framerate routine.
if all was done with my work, i will send the game
with high score table again to the forum!

best regards
peter
Post 08 Apr 2009, 18:01
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 09 Apr 2009, 00:02
Cool Cool
Post 09 Apr 2009, 00:02
View user's profile Send private message Visit poster's website Reply with quote
SFeLi



Joined: 03 Nov 2004
Posts: 138
SFeLi 09 Apr 2009, 12:18
xpeter, is it possible to get rid of GdiTransparentBlt making it work in 98?
Post 09 Apr 2009, 12:18
View user's profile Send private message Reply with quote
xpeter



Joined: 26 Mar 2009
Posts: 12
Location: Germany
xpeter 09 Apr 2009, 16:24
Hi SFeli,

that's not possible.
Post 09 Apr 2009, 16:24
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 09 Apr 2009, 19:22
It is actually, but it is not straightforward.

http://web.archive.org/web/20080105000448/http://msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_transblt.asp

I have used the "black source method" and worked.

I'll paste some of the code but not all since I plan to do so when I finish it (I'm not currently working on it now but I'll do in the future).

Code:
; Bitmaps.asm

  robotBitmap         BITMAPINFOHEADER sizeof.BITMAPINFOHEADER,\ ; DWORD  biSize
                                       ROBOT_SIZE,\              ; LONG   biWidth
                                       -9*ROBOT_SIZE,\           ; LONG   biHeight
                                       1,\                       ; WORD   biPlanes
                                       8,\                       ; WORD   biBitCount
                                       BI_RGB,\                  ; DWORD  biCompression
                                       0,\ ; DWORD  biSizeImage
                                       0,\                       ; LONG   biXPelsPerMeter
                                       0,\                       ; LONG   biYPelsPerMeter
                                       4,\                       ; DWORD  biClrUsed
                                       0                         ; DWORD  biClrImportant
db 255,255,255,0
db 0,   0, 255, 0
db 0,   0, 192, 0
db 0,   0,  96, 0
db 0,   0,   0, 0

align 4
  robotBitmap.bits:
;;;; NORTH
                   db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\
                      4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\
                      4, 2, 2, 4, 4, 4, 4, 4, 4, 2, 2, 4,\
                      4, 3, 3, 1, 4, 4, 4, 4, 1, 3, 3, 4,\
                      4, 2, 2, 1, 4, 4, 4, 4, 1, 2, 2, 4,\
                      4, 3, 3, 1, 4, 4, 4, 4, 1, 3, 3, 4,\
                      4, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 4,\
                      4, 3, 3, 1, 1, 1, 1, 1, 1, 3, 3, 4,\
                      4, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 4,\
                      4, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 4,\
                      4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\
                      4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
;;;; MASK
                   db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
                      0, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 0,\
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
;;;; EAST
                   db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\
                      4, 4, 3, 2, 3, 2, 3, 2, 3, 2, 4, 4,\
                      4, 4, 3, 2, 3, 2, 3, 2, 3, 2, 4, 4,\
                      4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4,\
                      4, 4, 4, 1, 1, 1, 4, 4, 4, 4, 4, 4,\
                      4, 4, 4, 1, 1, 1, 4, 4, 4, 4, 4, 4,\
                      4, 4, 4, 1, 1, 1, 4, 4, 4, 4, 4, 4,\
                      4, 4, 4, 1, 1, 1, 4, 4, 4, 4, 4, 4,\
                      4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4,\
                      4, 4, 3, 2, 3, 2, 3, 2, 3, 2, 4, 4,\
                      4, 4, 3, 2, 3, 2, 3, 2, 3, 2, 4, 4,\
                      4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
;;;; MASK
                   db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
                      0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0,\
                      0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0,\
                      0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0,\
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
;;;; SOUTH
                   db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\
                      4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\
                      4, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 4,\
                      4, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 4,\
                      4, 3, 3, 1, 1, 1, 1, 1, 1, 3, 3, 4,\
                      4, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 4,\
                      4, 3, 3, 1, 4, 4, 4, 4, 1, 3, 3, 4,\
                      4, 2, 2, 1, 4, 4, 4, 4, 1, 2, 2, 4,\
                      4, 3, 3, 1, 4, 4, 4, 4, 1, 3, 3, 4,\
                      4, 2, 2, 4, 4, 4, 4, 4, 4, 2, 2, 4,\
                      4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\
                      4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
;;;; MASK
                   db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
                      0, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,\
                      0, 4, 4, 0, 0, 0, 0, 0, 0, 4, 4, 0,\
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
;;;; WEST
                   db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,\
                      4, 4, 2, 3, 2, 3, 2, 3, 2, 3, 4, 4,\
                      4, 4, 2, 3, 2, 3, 2, 3, 2, 3, 4, 4,\
                      4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4,\
                      4, 4, 4, 4, 4, 4, 1, 1, 1, 4, 4, 4,\
                      4, 4, 4, 4, 4, 4, 1, 1, 1, 4, 4, 4,\
                      4, 4, 4, 4, 4, 4, 1, 1, 1, 4, 4, 4,\
                      4, 4, 4, 4, 4, 4, 1, 1, 1, 4, 4, 4,\
                      4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4,\
                      4, 4, 2, 3, 2, 3, 2, 3, 2, 3, 4, 4,\
                      4, 4, 2, 3, 2, 3, 2, 3, 2, 3, 4, 4,\
                      4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
;;;; MASK
                   db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\
                      0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0,\
                      0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0,\
                      0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0,\
                      0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0,\
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0      


Code:
; city.asm

enterRobot:; EBX = Robot
  invoke  CreateCompatibleDC, [globals.windowDC]
  mov     [ebx+CityRobot.backBuffer], eax
  test    eax, eax
  jz      leonardoThreadProc.fail

  CBM_INIT = 4
  invoke  CreateDIBitmap, [globals.windowDC],\
                          robotBitmap,\
                          CBM_INIT,\
                          robotBitmap.bits,\
                          robotBitmap,\
                          DIB_RGB_COLORS
  test    eax, eax
  jz      leonardoThreadProc.fail

  invoke  SelectObject, [ebx+CityRobot.backBuffer], eax
  test    eax, eax
  jz      leonardoThreadProc.fail

  mov     [ebx+CityRobot.x], 0
  mov     [ebx+CityRobot.y], 0
  call    saveCity
  call    paintRobot

  ret

paintRobot:; EBX = Robot
  push    esi
  movzx   esi, [ebx+CityRobot.orientation]
  imul    esi, ROBOT_SIZE*2

  invoke  BitBlt, [globals.backBufferDC], [ebx+CityRobot.x], [ebx+CityRobot.y], ROBOT_SIZE, ROBOT_SIZE,\
                      [ebx+CityRobot.backBuffer], 0, addr esi + ROBOT_SIZE, SRCAND
  invoke  BitBlt, [globals.backBufferDC], [ebx+CityRobot.x], [ebx+CityRobot.y], ROBOT_SIZE, ROBOT_SIZE,\
                      [ebx+CityRobot.backBuffer], 0, esi, SRCPAINT
  pop     esi
  ret             


And of course also exists the chance of just using a DIBSection and do all the work yourself.
Post 09 Apr 2009, 19:22
View user's profile Send private message Reply with quote
xpeter



Joined: 26 Mar 2009
Posts: 12
Location: Germany
xpeter 09 Apr 2009, 20:21
Hi LocoDelAssembly,

a bitmap creating in such manner is unusable for me. i have 400 bitmaps a. 32x32 ! what are you thinking when i am ready therewith ?
your showing methode is no solution for a game !

i think, when your robot bitmap has an animation,
let's say, sixteen phases
then your pleasure will fall into a deep cellar !

best regards
peter
Post 09 Apr 2009, 20:21
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 09 Apr 2009, 20:46
It would be as simple as having two sets of bitmaps, those that are colorful and those that are just black and white.

My code was just to show how to blit, but you are not forced to have the bitmaps the same way I do, I posted just to show the color and monochrome mask thing. In the link I posted you'll see a method that can construct the masks from your bitmaps, I haven't used that because my bitmaps were too simple and I haven't got those bitmaps generated with Paint or whatever, just that assembly file.
Post 09 Apr 2009, 20:46
View user's profile Send private message Reply with quote
xpeter



Joined: 26 Mar 2009
Posts: 12
Location: Germany
xpeter 09 Apr 2009, 22:03
yes i know,
it was only a reflection about the kind of
making bitmaps.
sorry, for the misunderstanding.
Post 09 Apr 2009, 22:03
View user's profile Send private message Reply with quote
xpeter



Joined: 26 Mar 2009
Posts: 12
Location: Germany
xpeter 15 Apr 2009, 18:11
Hi,

new entry here!
Peter
Post 15 Apr 2009, 18:11
View user's profile Send private message Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 172
Location: Maryland, USA
rCX 17 Apr 2009, 02:26
@xpeter
Thanks, this new version works much better on my XP system. The hourglass would always visible in the older version.

@Loco
hmm a city with robots sounds fun. I'm looking forward to its release!
Post 17 Apr 2009, 02:26
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 17 Apr 2009, 03:12
I think I'll kill your expectations right now.

As you can see the graphics wont gonna be a big thing, the only improvement will be a different color for each robot, but not much else. Also not that it wont be a game neither, it is supposed to be an educative tool but I'll tell details later. (This is not Heap, this thread is for discussing xpeter's game Wink)


Description:
Filesize: 11.38 KB
Viewed: 24503 Time(s)

screenshot.PNG


Post 17 Apr 2009, 03:12
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20363
Location: In your JS exploiting you and your system
revolution 17 Apr 2009, 03:16
LocoDelAssembly wrote:
I think I'll kill your expectations right now.
Oh, were we supposed to have some expectation from you? I don't understand what you are trying to say in the picture. Is that a program you are working on now?
Post 17 Apr 2009, 03:16
View user's profile Send private message Visit poster's website Reply with quote
AnonyZhang



Joined: 19 Mar 2010
Posts: 2
Location: China
AnonyZhang 19 Mar 2010, 14:05
It seems that it can't exit normally. but it's really good.
I'm a chinese, i want to make friends with you.
I use the google e-mail usually, I've installed Gtalk on my computer. so i invite you all...
Post 19 Mar 2010, 14:05
View user's profile Send private message Send e-mail Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.