« XNA Curriculum Materials | Main | Money from XNA »

The Doctor is In

The first patient has been received in the Very Silly Games surgery, patched up and sent back to a waiting developer. If you are learning XNA and hit a nasty problem, feel free to check in your source files at the silly surgery for our trained medics to take a look at.

Posted on Friday, August 22, 2008 at 10:04AM by Registered CommenterRob | Comments5 Comments

Reader Comments (5)

Thanks again Rob ! I'm currently sorting out input so the player can affect the ball in some way. I'm robably going to add gravity and such aswell !

August 27, 2008 | Unregistered CommenterJDog

Gravity is actually quite easy, and one of the places where any physics that you have learnt starts to become useful!

August 28, 2008 | Registered CommenterRob

Warning...Long post !

Infact Rob, i've done gravity already now, the ball bounces perfectly and you can apply "wind" to move the ball either left or right. One question though...Did you apply a special program to make the outer edges of the ball, i.e the non ball part invisible or is that colour simply ignored anyway ?

Also how do you change the reference point of a sprite from the top left to the centre because when I do "circle to circle" collisions they have to be from centre to centre.

The good news is, I really like C# alot and i'm picking the language up quite quickly too. The only thing i'm worried about is when I go to Uni someone will tell me that all my programming is wrong and that I should code to a specific style...but if i'm right, there aren't any specific styles.

When I get my ball program done to the point where I can spawn multiples then they bounce around and delete when off screen, i'll send it to you to show you what I did.

August 28, 2008 | Unregistered CommenterJDog

Congratulations, sounds like you are doing really well.

The special program I used to make the outer edges of the ball was Photoshop Elements. The bitmaps are drawn using transparency, and have transparent edges. You can use Paint .NET (which is free) instead.

If you want sprites to rotate, take a look at other forms of the Draw method. There is one where you can specify the origin of the draw and a rotation angle.

Don't worry about programming style, it is something that you get by writing a lot of code. And remember tha that the nicest thing that anyone can say about any program is "it works and it does what I want". I'd much rather have ugly code that solves the problem than an elegant solution to the wrong problem. Or one that crashes.

September 5, 2008 | Registered CommenterRob

I also like the idea of "ugly" code that does what I want it too aswell. If it works, then I don't need to change it, so I don't...I'm in the process of making the Ball rotate, I'll worry about the reference point later. I'm probably going to make rotation speed = to the X movement speed, albeit positive or negative.

I heard a rumour that I must learn Maths yet again and will be tested when I start University or at somepoint throughout my course, is this true ?

Also, ho did you know I was working on rotation at the moment on my current project, I don't remember mentioning it anywhere...

September 6, 2008 | Unregistered CommenterJDog

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>