Tuesday, June 5, 2012

WP7 Game Development Tutorial for Absolute Beginner - Updated

I started following this tutorial when I was looking for Windows Phone 7 (WP7) development for absolute beginner. It was for game development. Still trying to finish it. It is a good tutorial, but you may need to tweak some of it a little bit. If you are a real absolute beginner who never touches programming or scripting, you could go here. It's a slow paced tutorial (I never passed the Day 1 mark) but the guy (Bob Tabor) explains really well for you. Anyway, I will discuss the problems I encountered.

Firstly, the position of the player after a few steps changed. It is no longer at the desired position near the center. It will be a little bit up and to the left. Also, the movement is restricted not to the viewport (viewport is the window of the game) but to the left and to the top of the viewport, like this.
____________________
|     _________________|___              Red box is the restricted area of movement
|    |                                  |      |              while black box is the viewport.
|    |                                  |      |
|__|_________________|      |
     |____________________|


To solve it, you need to look for the code which get the value of the player width and height divided by two. I believe it was meant to fix the aforementioned problem, but probably due to version update or something, it CREATES the problem. What is happening is that previously, probably the program calculate the origin of x and y of the player image at the center of the image, while the real thing is at the top left corner of the image. Thus, the problem. By the way, x-axis in the viewport starts from the left while y-axis from the top.

Secondly, you will find that at the tutorial about collision, there is a problem. Sometimes your projectile missed and I can't remember the other problem (I think the starting position of the projectile is wrong). Same problem as above. You need to find out which vector values are wrong. The enemy's rectangle is too high, delete the value of its height divide by 2. If you think the rectangle of the projectile is too to the left, don't, or your projectile will be gone before it touches the enemy's image (when the projectile's image enters the enemy's rectangle but does not touch the enemy's image yet, it is not removed).

Thirdly, after you reach the tutorial about explosion, you will find that the explosions occurs not at the center of the enemy image, but rather at the bottom right corner of the enemy image. I am still figuring out how to fix it, be patient :)

I don't know if the problem is because of the program's version in my computer, but if you encounter the same problems, there you go. :)
And for the record, I am a beginner, although not absolute.


*Update 1:
Seems that the link to the tutorial is gone. I will try too look into it again. If you have any idea where it goes to, could you help me by posting it in the comment? Thanks.

*Update 2:
Okay. I found the link to the tutorial: http://channel9.msdn.com/Blogs/The-XNA-Show/XNA-Game-Development-Intro and http://channel9.msdn.com/Blogs/The-XNA-Show?page=2 . However, it seems that the written tutorial is gone. Can't do much about it. One comment states just go to create.mdsn.com and find the game tutorial there, but I could not find it.

No comments:

Post a Comment