Home Forums WinForms controls Xceed Grid for WinForms Arkanoid :) Reply To: Arkanoid :)

Xceed Support
Member
Post count: 5658

Hi Nick!

I’m glad to see that you enjoyed the game! I was actually the one who did the coding in Arkanoid so I will be able to give you a starting point if you want to change the sample code to includes your ideas.

First of all, you will need to add values in the BlockTypeEnum (you can find it in the ArkanoidEnumerations.cs file) for each type of block you want to add. The class that interests you is the BlockCell class. It is derived from the DataCell class of the grid. It is in charge of painting the block, checking to see if a block is destroyed, and so on. You can change the appearance of a block, depending on your new block types, in the PaintForeground event. As for changing the ball’s behavior, you will do that in the Hit method. This method is called by the Ball class. (which is in charge of painting the ball, make it move) You will probably need to add some parameters to the method to inform the ball what to do. You already have the direction and other parameters but you are missing one if you want to change the ball speed. (this method is actually implemented by the IHit interface so you will have to update every class that implement it)

I hope this will help you achieve your goal!

Imported from legacy forums. Posted by Jacques [Xceed] (had 283 views)