|
Now what?The following cool features are left for the reader to implement: 1. Add the sun and the rest of the planets, and make them bounce against each other as well as the walls. Make buttons to add/remove them. 2. Make it possible to hit the ball like you would hit a tennis ball, by moving the mouse towards the ball with the left button pressed. You'll need to make the timer continuously active, so you can record the mouse velocity when you hit the ball, enabling you to hit hard or softly. If you want to make the ball move correctly when you hit it at an angle, you'll also have to add some clever calculations for that. 3. Make the ball spin as well as bounce, depending on how you hit/throw it, and/or make it (the earth) spin around it's axis. You'll have to create the extra graphics needed yourself. 4. Add an option to zero the resistance, making the ball bounce into infinity. (and beyond..!) 5. Make the entire window shake when the ball hits the walls real hard. Now grab the source: Download the attached file bounce.tar.gz (27 Kb) at the bottom of this page. Bounce is released under the GPL. Requires: Qt and tmake, available from TrollTech. (It was developed with Qt-2.2.1, but may work with any previous release, provided it has the QCanvas class.) Build instructions:
Have fun! Attached files: Comment List
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||