Author Topic: Direct2d breakout  (Read 804 times)

caballero

  • Member
  • *****
  • Posts: 1084
    • abre ojos ensamblador
Re: Direct2d breakout
« Reply #15 on: May 26, 2018, 06:42:53 AM »
-1 :t
En un lugar de la Mancha de cuyo nombre no quiero acordarme

- There are 10 kind of people: those who know binary numbers and those who don't -

BugCatcher

  • Regular Member
  • *
  • Posts: 42
Re: Direct2d breakout
« Reply #16 on: June 16, 2018, 12:48:04 AM »
Updated mouse coordinates on screen resize.
There is a scores screen. -No text yet.
There is a Start game.

Tried to use mouse messages for the paddle,way too herkie jerkie. So I translated DirectInput8,and now the paddle is very smooth and fast.

Need .686 directive for floating point. (?)

Next is the dreaded collision detection. -Gulp                                   -
« Last Edit: July 08, 2018, 04:58:41 AM by BugCatcher »

Caché GB

  • Member
  • **
  • Posts: 61
  • MASM IS HOT
Re: Direct2d breakout
« Reply #17 on: June 16, 2018, 01:17:29 AM »
Hi BugCatcher

Try this

Code: [Select]
;#############################################################################################################

MsgLoopMain PROC

    Local  wMsg:MSG

       invoke  RtlZeroMemory, addr wMsg, sizeof(MSG)
          mAm  wMsg.hwnd, TheApp.hWind

    .while  true
       invoke  PeekMessage, addr wMsg, null, 0, 0, PM_REMOVE
      .if (eax != 0)
         .break .if (wMsg.message == WM_QUIT)
          invoke  TranslateAccelerator, TheApp.hWind, TheApp.hAccel, addr wMsg
         .if (eax == 0)
             invoke  TranslateMessage, addr wMsg
             invoke  DispatchMessage, addr wMsg
         .endif 
      .else
         invoke  UpdateTimers

         invoke  UpdateDetectInput
         invoke  UpdateCamera     
         invoke  UpdateScene
         invoke  RenderScene

      ;;   For BugCatcher
      ;;              V  V
         invoke  SleepEx, null, false   ;; <-- Give up the rest of your time slice.

      .endif
    .endw
 
       return  wMsg.wParam

MsgLoopMain ENDP

;#############################################################################################################

Caché GB's 1 and 0-nly language:MASM

BugCatcher

  • Regular Member
  • *
  • Posts: 42
Re: Direct2d breakout
« Reply #18 on: June 16, 2018, 02:25:44 AM »
Ok here it is.

Code: [Select]
  .WHILE TRUE
invoke PeekMessage, ADDR msg, NULL, 0, 0, PM_REMOVE
.if (eax != 0)
;===================================
; Break if it was the quit messge
;===================================
mov eax, msg.message
.IF eax == WM_QUIT
;======================
; Break out
;======================
jmp shutdown
.endif

;===================================
; Translate and Dispatch the message
;===================================
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.endif

invoke Main_Game_Loop,hWnd
.if PaddleActivated?
invoke DI_Read_Mouse,hWnd
invoke Process_Paddle
.endif

invoke  SleepEx, 0, FALSE   ;; <-- Give up the rest of your time slice.
.ENDW

Caché GB

  • Member
  • **
  • Posts: 61
  • MASM IS HOT
Re: Direct2d breakout
« Reply #19 on: June 16, 2018, 02:44:36 AM »
Hi BugCatcher.
This looks awesome. I can't wait till it's complete. 
Caché GB's 1 and 0-nly language:MASM

BugCatcher

  • Regular Member
  • *
  • Posts: 42
Re: Direct2d breakout
« Reply #20 on: July 08, 2018, 04:51:02 AM »
Collision detection is finished. Small bug in paddle,no big thing. Bricks light up.

Next is some specialized bricks for more fun.
Finish high score screen.

felipe

  • Member
  • ****
  • Posts: 928
  • Eagles are just great!
Re: Direct2d breakout
« Reply #21 on: July 08, 2018, 08:16:50 AM »
Hey bugcatcher the game is not working all ok by now (at least on my pc  :idea:) but if you can finish it, this will be sure a great game. Congrats. :icon14:
Felipe.