Game Development Community

The Breakout Tutorial - Part Five

by Tetraweb · in Torque Game Builder · 04/01/2008 (6:57 pm) · 20 replies

Part Five of The Breakout Tutorial is now live. This thread is intended for discussion, questions and problems specifically related to Part Five.

Thanks,
Greg
The Breakout Tutorial

#1
04/14/2008 (1:21 pm)
First off, I'd like to say thanks for the tutorial, I've been going through it, and making some uppercase changes to some of the variables, but I've come across a little snag, I'm not sure if it's my fault or something that got screwed up with the tutorial.

Here's the problems I'm currently having:
Only two icons with 3 balls show up (i'll check the code to make sure I'm not duplicating the position).
The ball does not respawn (I'm not sure about this one, it was working before this last series)

The MainMenu shows me able to play only Level 3, keeping 1 and 2 locked. I thought it would start at 1, and have 2 and 3 be locked initially.

I'm going to re-go Over the code again to see if I can find anything I might have messed up (which I did a few times, with global and local variables).

Just curious as to the nature of these problems. The log file shows no errors (after I fixed all the other things I messed up), so I'm thinking maybe I have some other referencing problems.

If you'd like I can send you what I have thus far, let me know.

Anxiously waiting for the next steps in this series!

Edit: I found out my problems with all that was going on. I had copied the levelButtons when I typed them in and forgot to change the id to 3 on the 3rd button. The Iconimages was another accidental global instead of a local, and my balls do load (I thought they didn't). Everything works now!
I always type in the code, to keep my own spacing and tabbing, it's just something I like to do, plus it's far better learning to actually type in the code then just copy and paste.
#2
04/14/2008 (5:12 pm)
Well, that's really the best way, typing in the code instead of copying and pasting. I'm sure most people don't do that., though.

Almost as good, and with less chance of errors like you had (though solving the errors make you a stronger programmer!) is pasting it in, but really paying attention to the line by line overview so you know what you are pasting in.

The least beneficial way to approach a tutorial is to skim the text and copy and paste the code. I'm glad you are doing the opposite.

Part 6 is at least 3 days away, I'm afraid. I didn't intend it to take this long, but I've had some other things going on unexpectedly.

Greg
#3
04/14/2008 (9:07 pm)
I totally agree with you there. I'm an avid programmer myself, and I am always eager to learn more. That's why these user tutorials are extremely beneficial. Not only do new users get a chance to learn from those of us who are more experienced, but also for people like me who know a great deal about programming seeing new ways to handle certain designs.

I always type in the code manually with any tutorial, not only because I feel I get a better understanding, but more often than not with the tutorials here, is that they are outdated, and have to be adjusted to the new engine. I'm still working on a networking game tutorial (which I've been really slacking on the past month).

One other question for you, are you planning on sharing the other levels that you made for this? I'm assuming you have at least 10 levels created for it (given you have 10 backgrounds). It would be really nice to have those additional assets as well. Also, I'm curious as to whether or not you made a Level Maker for the tile maps? I think that would be awesome, so that way you could load up custom levels, and increase the end-user ability to have more dynamic control and offer flexibility in the way the game can be played.

If not, perhaps after the last tutorial, I might even take on that challenge myself. I'm really looking forward to the following steps, and if there's any way I could help out, I'd be glad to do so. You can always send an e-mail to that which is listed on my account.

Keep up the good work!
#4
04/14/2008 (10:09 pm)
Doc308: I've been doing this tutorial myself and on this part of it I've got the basic menu running but it doesn't load any levels yet. I'm at the beginning of the Loading the Level section. I just thought I'd report that the ball icons and locked out levels are working as advertised.

I had some problems with getting all the ball icons and things to show up, but it was just my own stupid typos or simple things like forgetting to put a semicolon at the end of the line. Be sure to check the console for script errors, such as not being able to load a file or being unable to perform an action on an object, etc.

I especially like Torsion because if you try to run the script from torsion it will highlight your errors and you can go straight to them.
#5
04/15/2008 (5:02 am)
Thanks guys.

@Doc308 - yes there are 10 levels introduced in Part 7, I try to make it as full a game as possible when the tutorial ends. Regarding a levelmaker, I add some new brush types in Part 6 as you will see, and TGB itself becomes kind of a levelmaker itself.

However, a real standalone levelmaker is beyond the scope of the tutorial. I am including a rough idea for it in the "Things to Try on Your Own" part at the end, along with ideas for several other powerups, etc.

Greg
#6
05/23/2008 (7:26 pm)
Hey Man, I just wanted to say thanks a million. I dont consider myself a rank amateur when it comes to programming. I have programmed in Java, C++, C# and Actionscript for a long time(its what I do for a living). But I could not really get my head around the scripting code for TGB, untill this tutorial. I was having an easier time with design patterns in c++ :).
I don't know man, I just could not get the "flow" of TGB.
This tutorial has restored my faith in this engine. Through your explanations I have finally been pointed in the right direction in terms of data structures and program flow. Now I can take it from here because I have a really solid base to start from. Nothing against the other tutorials though, just like to thank you again for helping a "Brotha Out".
Later.
#7
05/24/2008 (6:28 am)
Appreciate it. I want everyone to know that the series has NOT been abandoned. I have a little boy who came five weeks early and it threw me a little bit.

I am back hard at work now, and the last two in the series are really fun, with powerups and special tiles, etc.

Greg
#8
08/26/2008 (6:51 am)
Awesome Greg! This is definite something that the TDN for TGB needs. I cant wait for the last 2 episodes to complete my first (tutorial based) game :o)

Congrats to your little boy. I guess he will keep you awake for a long long time. *g*

Thumbs up!!!!
#9
08/27/2008 (8:59 pm)
Great tutorial (so far?)

A couple of issues that may be more TGB than this game (it's my first tutorial, I just bought TGB). I noticed that in some instances the ball will get 'stuck' on the boundaries. I double-checked the settings on my boundaries and they are as the tutorial instructs... so not sure what is the issue there, maybe TGB collision issues?

Also, sometimes when I miss a ball, the new one will not bounce at an angle on the paddle (or arch), no matter what angle or speed I hit the ball in, it goes straight (vertically) up. I'm guessing the collision (or physics) settings go haywire but I checked the settings and they are also as the tutorial instructs.

Lastly, not sure if this will be covered in the latter parts. When the ball hits the corner of a brick it tends to go in a horizontal direction (that doesn't look good and hampers gameplay) where it should have bounced back down at a diagonal. Is there a way to test if the hit location was at a tile corner point?

Thanks again, great work!
#10
08/27/2008 (11:05 pm)
The problem with getting 'stuck' has happened to a few of us. If you go back to the first or second tutorial there's a workaround, but I'm not really pleased with it (I suspect in later tutorials when we have multiple balls on the screen this workaround - disabling the collision on the wall - could cause some balls to be lost).

A new ball will ALWAYS go straight up the first time you launch it. It's due to the position and the normal that are set when you create it. Or are you saying you launch the new ball and when it comes back you can hit it with the side of the paddle and it still goes straight up? I'd check and maybe fine-tune the collision poly on the paddle for that.

I'm sure there's a way to detect whether the ball hit on (or near) a corner of a brick. It'll involve some math, but the added function to convert a tile to world coordinates would be a good starting point.
#11
09/16/2008 (8:58 am)
Dude, what happend to the last 2 episodes? A few weeks you said part 7 was nearly done?!?

Hope you can release the last tuts soon. Thank you very much.
#12
11/14/2008 (6:07 am)
Any update on when parts 6 and 7 will be available ?

Thanks

-Mic
#13
03/08/2009 (9:39 pm)
Great job on the tutorial! I ran into a couple thing on section 5

My score is no longer working and I can't get the menu background to show up. has anyone else ran into this?
#14
03/08/2009 (9:53 pm)
I figured out the menu image issue

I fixed the scoring issue I was missing
$multifactor = 1.0; //point multiplier factor
#15
05/07/2009 (7:03 pm)
Not abandoned. Back at work on parts 6 and 7. Stay tuned.

Greg
#16
06/18/2009 (11:11 pm)
Hey Greg, This is the best tutorial i've seen so far. Looking forward to 6 and 7!
#17
07/28/2009 (10:25 am)
Just wanted to add yet again - great tutorial.

Well done to Greg and Tetraweb.

Hope the new installments are out soon.

Cheers
#18
09/24/2009 (3:35 pm)
This is the most helpful t2d tutorial, thanks.
#19
05/02/2010 (8:34 pm)
Hi thanks, the tutorial is working as advertised. :)
#20
05/03/2010 (5:07 pm)
I just found this and am about to start on it. It looks great. Is it safe to assume that since the "Not abandoned" comment was about a year ago, give or take a few days, that they won't be coming?

Either way, thanks for the tutorial.