Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualBaneTrapper

Posted 05 December 2012 - 07:32 AM

That would work, i mostly did it this way :
Input
Collision
Drawing

In input handle key press and update the pad position. NOTE update the ball position too before collision checking
In collision check for ball collision with blocks and pad
Drawing comes next
repeat until won / lost

What i have questions about is :
(check collision) then you do (brick collision)
shouldn't you put this into one? i mean check collision invokes (ball to everything check) since that's only thing that moves in breakout game, unless you have powerUP.

(timer func) what is this used for?
If its used to get delta time it should be called first in loop or last

(glut main loop)
If you have (draw scene) already i am unsure what is this used for.

#3BaneTrapper

Posted 05 December 2012 - 07:31 AM

That would work, i mostly did it this way :
Input
Collision
Drawing

In input handle key press and update the pad position. NOTE update the ball position too before collision checking
In collision check for ball collision with blocks and pad
Drawing comes next
repeat until won / lost

What i have questions about is :
(check collision) then you do (brick collision)
shouldn't you put this into one? i mean check collision invokes (ball to everything check) since that's only thing that moves in breakout game, unless you have powerUP.

(timer func) what is this used for?
If its used to get delta time it should be called first in loop or last

(glut main loop)
If you have (draw scene) already i am unsure what is this used for. From what i remember you should call this before updating the draw scene

EDIT::
What i have found about glut main loop

Description

glutMainLoop enters the GLUT event processing loop. This routine should be called at most once in a GLUT program. Once called, this routine will never return. It will call as necessary any callbacks that have been registered.


#2BaneTrapper

Posted 05 December 2012 - 07:29 AM

That would work, i mostly did it this way :
Input
Collision
Drawing

In input handle key press and update the pad position. NOTE update the ball position too before collision checking
In collision check for ball collision with blocks and pad
Drawing comes next
repeat until won / lost

What i have questions about is :
(check collision) then you do (brick collision)
shouldn't you put this into one? i mean check collision invokes (ball to everything check) since that's only thing that moves in breakout game, unless you have powerUP.

(timer func) what is this used for?
If its used to get delta time it should be called first in loop or last

(glut main loop)
If you have (draw scene) already i am unsure what is this used for

EDIT::
What i have found about glut main loop

#1BaneTrapper

Posted 05 December 2012 - 07:27 AM

That would work, i mostly did it this way :
Input
Collision
Drawing

In input handle key press and update the pad position. NOTE update the ball position too before collision checking
In collision check for ball collision with blocks and pad
Drawing comes next
repeat until won / lost

What i have questions about is :
(check collision) then you do (brick collision)
shouldn't you put this into one? i mean check collision invokes (ball to everything check) since that's only thing that moves in breakout game, unless you have powerUP.

(timer func) what is this used for?
If its used to get delta time it should be called first in loop or last

(glut main loop)
If you have (draw scene) already i am unsure what is this used for

PARTNERS