Brickout in progress
by Drew -Gaiiden- Sikora · in Torque Game Builder · 02/27/2005 (11:38 pm) · 9 replies
So I got the beginnings of a Brickout clone going on after a few hours work this night. Really starting to get the hang of the scripting and file structure, though the physics are still giving me hassles. I've never worked with a real physics engine before so it's a bit of a learning curve. Anyways, here's what I have done so far:
* brick tile map is loaded
* bricks disappear when hit
* paddle moves
* ball bounces about
* 15 capsules are assigned to random bricks on load
* released capsules change paddle/ball
----> Ball capsules add an extra ball (tested) for 45s
----> Super capsules make the ball go straight through bricks, destroying them (untested) for 15s
----> Long capsules increase the width of the paddle (untested) no time limit (changes when Fire capsule is picked up)
----> Fire capsules allow you to shoot at bricks (tested - paddle changes, can't fire yet tho) for 35s (or when Long capsule is picked up)
* reset when ball misses paddle and hits bottom of window
And here are some notes:
* My physics model sucks. I hardly have any idea what I'm doing still :P In fact, the paddle/ball collisions are manual revectors because the ball kept reflecting off the paddle at an insanely oblique angle with physics collision enabled.
* My code itself is pretty messy, and by that I mean disorganized, but well commented
* I did recently add in the torpedo effect from the scroller demo to distinguish the extra ball (sidekick) from the real one, but it doesn't seem to show up...
* Still need to add an explosion effect for the bricks when they get hit
* Couldn't figure out how to get the world position of a tile, so when a capsule is created you'll notice it's created at the point where the ball hits the brick. Satisfactory, but not perfect.
* The game does try and detect when all the bricks are gone and reset the board, but I'm doing something wrong because I've cleared all the bricks and nothing's happening. Doh.
So that's about it... I think I'm going to can it for the night, got a lot of other stuff to do I put aside to play with this baby :) Hope this is helpful to some, and hope some can help me make things better :)
members.gamedev.net/gaiiden/source/t2d/brickout.zip
Just unzip straight to the examples folder and run the batch file.
* brick tile map is loaded
* bricks disappear when hit
* paddle moves
* ball bounces about
* 15 capsules are assigned to random bricks on load
* released capsules change paddle/ball
----> Ball capsules add an extra ball (tested) for 45s
----> Super capsules make the ball go straight through bricks, destroying them (untested) for 15s
----> Long capsules increase the width of the paddle (untested) no time limit (changes when Fire capsule is picked up)
----> Fire capsules allow you to shoot at bricks (tested - paddle changes, can't fire yet tho) for 35s (or when Long capsule is picked up)
* reset when ball misses paddle and hits bottom of window
And here are some notes:
* My physics model sucks. I hardly have any idea what I'm doing still :P In fact, the paddle/ball collisions are manual revectors because the ball kept reflecting off the paddle at an insanely oblique angle with physics collision enabled.
* My code itself is pretty messy, and by that I mean disorganized, but well commented
* I did recently add in the torpedo effect from the scroller demo to distinguish the extra ball (sidekick) from the real one, but it doesn't seem to show up...
* Still need to add an explosion effect for the bricks when they get hit
* Couldn't figure out how to get the world position of a tile, so when a capsule is created you'll notice it's created at the point where the ball hits the brick. Satisfactory, but not perfect.
* The game does try and detect when all the bricks are gone and reset the board, but I'm doing something wrong because I've cleared all the bricks and nothing's happening. Doh.
So that's about it... I think I'm going to can it for the night, got a lot of other stuff to do I put aside to play with this baby :) Hope this is helpful to some, and hope some can help me make things better :)
members.gamedev.net/gaiiden/source/t2d/brickout.zip
Just unzip straight to the examples folder and run the batch file.
#2
Re-reading my post, I hope you didn't take it the wrong way. I meant my implimentation of the physics sucks, not the physics system itslef :P
I was thinking about the circular object, but I didn't really know enough still and I figured I'd rather keep it simple. I managed to hack out something that worked anyways, lol. I also did indeed play around with collision materials. Kinda sorta got the hang of it... I think :P Looking forward to those physics tutorials tho - just don't kill yourself :P I'll chime in with everyone else - get some sleep!! ;)
02/28/2005 (2:24 am)
Thx Melv, you guys got a great thing going on here - glad I can be a part of it.Re-reading my post, I hope you didn't take it the wrong way. I meant my implimentation of the physics sucks, not the physics system itslef :P
I was thinking about the circular object, but I didn't really know enough still and I figured I'd rather keep it simple. I managed to hack out something that worked anyways, lol. I also did indeed play around with collision materials. Kinda sorta got the hang of it... I think :P Looking forward to those physics tutorials tho - just don't kill yourself :P I'll chime in with everyone else - get some sleep!! ;)
#3
No probs. It did make me think about what you meant there for a second but the rest of your post clarifies it, so no probs. :) You can always edit your post slightly. ;)
We'll get you those docs ASAP though as the physics is such a powerful tool for making games.
Good luck bud.
- Melv.
02/28/2005 (3:30 am)
Drew,No probs. It did make me think about what you meant there for a second but the rest of your post clarifies it, so no probs. :) You can always edit your post slightly. ;)
We'll get you those docs ASAP though as the physics is such a powerful tool for making games.
Good luck bud.
- Melv.
#4
for my paddle ball collisions, its all manual too, plus on my X velocity i added in a lil amount of force depending on which way my paddle was moving.
But looks likes your a bit ahead of me. :)
02/28/2005 (3:32 am)
Lol i was doing the same type of game too.for my paddle ball collisions, its all manual too, plus on my X velocity i added in a lil amount of force depending on which way my paddle was moving.
But looks likes your a bit ahead of me. :)
#5
You are doing a great job here by the way, thanks for sharing this game with people. Just to note: be sure to read the information near the end of the tutorial about packaging up your game for public release before you make this available publicly. Remember that the EULA requires you to not distribute raw .cs files. Thanks! And again, as the tutorial states, we'll have a packaging tool that will take care of all the editor and raw script stuff for you. :)
02/28/2005 (3:38 am)
Drew, thanks for the clarification there too. I misunderstood too, thought you were saying the physics model in T2D had problems, and I was definitely surprised. :) I edited your post so that it's clear what you mean, hope you don't mind.You are doing a great job here by the way, thanks for sharing this game with people. Just to note: be sure to read the information near the end of the tutorial about packaging up your game for public release before you make this available publicly. Remember that the EULA requires you to not distribute raw .cs files. Thanks! And again, as the tutorial states, we'll have a packaging tool that will take care of all the editor and raw script stuff for you. :)
#6
And yes, I will make sure to follow the proper EULA guidelines for public releases.
02/28/2005 (10:30 am)
Thanks for the edit Josh :) Don't mind at all.And yes, I will make sure to follow the proper EULA guidelines for public releases.
#7
02/28/2005 (11:13 am)
Cool game Drew, only thing I would suggest is to speed up the bat and ball... I just played it and the ball went so slow it's just stopped at the top. :(
#8
Left Arrow - move paddle left
Right Arrow - move paddle right
Space - launch ball/fire guns (not implemented)
Z - send ball to the left
X - send ball to thre right
Yea, my physics model is all messed up, so I put the Z and X helper keys in there to keep things moving :P
02/28/2005 (11:34 am)
Whoops - knew I was forgetting something! Here are the keys:Left Arrow - move paddle left
Right Arrow - move paddle right
Space - launch ball/fire guns (not implemented)
Z - send ball to the left
X - send ball to thre right
Yea, my physics model is all messed up, so I put the Z and X helper keys in there to keep things moving :P
#9
02/28/2005 (11:43 am)
Ah z-x...... thats better :)
Associate Melv May
Really sorry about the confusion over the physics. We'll be organising a physics tutorial as soon as we can (so many tutorials to do). Sorry that you just have to "figure it out at the moment". One of the things to realise is that the system will be looking at friction and the fact that your object is square and so these funny angles are going to be correct. Certainly, I'd recommend having a circular ball, say 12-16+ polygon sides. Also, to get perfect bounces, you need to set the restitution pretty high else you get damping effects etc. You should've seen the angles that the balls in the "Pool" demo cames off the cushions before I realised I had the friction way too high. It was acting like a car with no wheels being dragged along a cobbled street!
There are in fact some simple collision-materials that can be setup that make the physics act in a nice simplistic manner you describe so that you get perfect bounces with no friction etc. This means that in a single call (setCollisionMaterial), you can setup any object.
More information on the way.
And dude ... thanks for the game!
- Melv.