here is the coordinate header file...coordinate.h...
ball.h
dialog.h
sample config file looks like this
now some explanation. coordinate class is for translating coordinate in Qt in a way that we are comfortable of. it means Qt consider top left corner (0,0), and while you're moving to right or down it increases the x and y coordinate. personally, I think we don't need this..well...here it is...
ball class has some functions needs proper implementation beside normal getter/setter methods. render and isCollision functions. isCollision function checks if the ball hit any edges of the box, and render function handle the ball movements.
dialog class is the core of this to put them all together. we used Singleton Design Pattern here to make sure only one instance of dialog exists at any time. I hope I explained it good enough, as I'm still learning. I'll post the implementation files and main method in near future, meanwhile stay hungry, keep coding
Some other information:
- this is not my code. mine was similar but it didn't changed colour when ball hits the box
- again this is implemented in Qt
- the actual website that have the tutorial on basic set up to start on this assignment can be found Here
Hi may I ask that you still keep OO quiz last year?
ReplyDeleteThanks
Hi, unfortunately not. we couldn't take the quiz paper out. quiz is easy, just normal stuff. you should be worried about assignments and final exam.and since the lecturer is changed this semester...last year lecturer was real good..., good luck
ReplyDelete