Jump to content


Photo

Brick Breaker 3D


  • Please log in to reply
15 replies to this topic

#1 howabout

howabout

    GMC Member

  • GMC Member
  • 99 posts

Posted 26 February 2012 - 10:13 PM

SO, first off, I would like to point out that I created this engine/game/thing BEFORE I even knew about prison ball. And then I FOUND prison ball, but on IOS. And anyone who has played it on iOS knows that it pretty much sucks on an Ipod 2nd gen. So I continued development because karoshi was the same on iOS and pc so I thought the same thing went for prison ball and therefore decided that that game sucked and I could do better. So, THIS. I know its simple, and I know you could easily recreate it, blah blah blah. Have fun. I guess. Download at host-a.net
  • 1

#2 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 26 February 2012 - 11:03 PM

so I thought the same thing went for prison ball and therefore decided that that game sucked


Oh I say... awfully rough, what? :sweat:

and I could do better.


...And your off to a good start! I love the screen shaking. And that big ball is really good. (prison ball's ball was far too small. Big mistake!)

The bouncing on the bat is a bit rough, I can't seem to aim it. I had to be patient, and wait for it to get through that gap in the second level.

So just 2 levels so far, right? 'cus I got an error after I beat the second one..

Anyway, your off to a good start! G'luck, I'll keep an eye on your progress.

[start spam]
I wrote up a 3d breakout 'tutorial', if your interested:
http://gmc.yoyogames.com/index.php?showtopic=504824&st=0&p=3730408&fromsearch=1&#entry3730408

It shows how to do little tricks&tips, (like making a ball visible behind blocks) and such like. More of an example, and pointing out little techniques that other 3d breakout games use, than a tutorial, really.

you sound pretty independant, but yeah, I encourage you to read through it at least! You may spy a feature which will tip your game from cool, to epic!
[end spam]
  • 0

#3 howabout

howabout

    GMC Member

  • GMC Member
  • 99 posts

Posted 26 February 2012 - 11:24 PM

so I thought the same thing went for prison ball and therefore decided that that game sucked


Oh I say... awfully rough, what? :sweat:

and I could do better.


...And your off to a good start! I love the screen shaking. And that big ball is really good. (prison ball's ball was far too small. Big mistake!)

The bouncing on the bat is a bit rough, I can't seem to aim it. I had to be patient, and wait for it to get through that gap in the second level.

So just 2 levels so far, right? 'cus I got an error after I beat the second one..

Anyway, your off to a good start! G'luck, I'll keep an eye on your progress.

[start spam]
I wrote up a 3d breakout 'tutorial', if your interested:
http://gmc.yoyogames.com/index.php?showtopic=504824&st=0&p=3730408&fromsearch=1&#entry3730408

It shows how to do little tricks&tips, (like making a ball visible behind blocks) and such like. More of an example, and pointing out little techniques that other 3d breakout games use, than a tutorial, really.

you sound pretty independant, but yeah, I encourage you to read through it at least! You may spy a feature which will tip your game from cool, to epic!
[end spam]

But, you are the creator of prison ball, are you not? I'm honored that you said what you did :D. Thank you so much! I will definatley have a look at the tutorial and be working alot more on this game.
  • 0

#4 ookami125

ookami125

    GMC Member

  • GMC Member
  • 217 posts
  • Version:GM:Studio

Posted 26 February 2012 - 11:26 PM

just reading this kinda makes me want to go make a brick breaker game but yea the controls could be better but overall it is a good start
  • 0

#5 howabout

howabout

    GMC Member

  • GMC Member
  • 99 posts

Posted 27 February 2012 - 12:21 AM

Well you guys, I am at a road block of sorts right now. I can not improve the aiming system as far as I know at the moment, because I want it to be different from desert dogs, I was first thinking maybe since the paddle is 64 pixels in length, I could check which side the ball collides on and make it go in that direction, but that can only check for one pixel as I am aware. Then I had the idea of checking if the place_meeting is smaller than 32 in length. As I type this I am about to try it out. Okay, I tried that and It does not work because the template for the function is place_meeting(x,y,obj) And I can not check if only one of them is smaller. Scratch that. Now, I had the idea of asking the game, when the ball collides with the paddle, if the paddle is clearly moving right and there fore the speed is bigger than 0, go right but if its going left and the speed is SMALLER than 0 than go left. and if its not moving at all than go up. Now there is one major problem with this. If you are using the mouse, there is no hspeed or vspeed. Therefore i can not check the speed the paddle is going. but using the arrow keys can fix that! So should I use the arrow keys instead? Help me out if you can, ill keep you posted.
  • 0

#6 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 27 February 2012 - 12:45 AM

Yep, I made Prison Ball. :P

Well you guys, I am at a road block of sorts right now. I can not improve the aiming system as far as I know at the moment,


I played many different breakout games (both 3d, and 2d) while making PB. There are several different methods most people use.

-'Fixed'. The ball always moves at a 45 degree angle, you just have to bounce it. This 'can' work quite well, but it depends on the room! A taller, thinner room, or a wider, short room so that there is little chance of the ball bouncing for ages without hitting anything!

-'aiming'. You hit the ball on the left side, and it bounces hard left, hit it in the middle, it flies up, and so forth.

-'Precise colliding'. When they have a curved bat! Shaped like a dome, the ball bounces off precisely.

If you are using the mouse, there is no hspeed or vspeed. Therefore i can not check the speed the paddle is going.


Could you move the bat with hspeed? If mouse is to the left, then hspeed-something, else, if to the right, etc.
  • 0

#7 howabout

howabout

    GMC Member

  • GMC Member
  • 99 posts

Posted 27 February 2012 - 12:51 AM

Could you move the bat with hspeed? If mouse is to the left, then hspeed-something, else, if to the right, etc.

Well that is a good idea. Do me a favor, click your middle mouse button. Now move it up and down the page, starting slowly and notice how the further away from the point where you clicked your mouse is, the faster it goes. I think this is what I am going to do using point_distance. Thanks!
  • 0

#8 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 27 February 2012 - 12:54 AM

Didn't know about that middle click trick. Nice! :P
  • 0

#9 howabout

howabout

    GMC Member

  • GMC Member
  • 99 posts

Posted 27 February 2012 - 01:07 AM

Didn't know about that middle click trick. Nice! :P

Quick update. Unfortunatley, since it is drawn in 3d, that does not work and it always goes too fast. I dont know what to do! I was also thinking that I could adjust the direction via the arrow keys and an arrow pointing to the direction it will go, but I tried it and it is too hard to control relative to the speed the game is playing at.
while(place_meeting(x,y,other))
{
    y-=1;
}

direction=90-(x-other.x);
This seems to be the code you used in your tutorial when the ball collides with the paddle. I do not understand :S . The thing with my game is, it is INCREDIBLY simple. As in other than the 3d functions, a beginner could probably understand. Do you mind explaining to me how this code works?
  • 0

#10 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 27 February 2012 - 01:31 AM

The first bit here:
while(place_meeting(x,y,other))
{
    y-=1;
}


simply moves the the ball 'up' so that it no longer collides with the bat. So it moves up 1 pixel, checks, still colliding, move up again, etc.

We don't want the bat, or ball to be solid (if they are, they automatically move outside each other). And using a function like move_outside_all the ball might end up beneath the bat.. or colliding with someother object.

The next bit:
direction=90-(x-other.x);

Is what we use to determine our direction.

If we center your bat sprite, then the bat x is the middle of the bat, and the ball x is the middle of the ball.

If the ball bounes directly in the middle of the bat, we get something like this:

direction=90-(0-0);

Which is, direction=90. Which is straight up!

If the ball is to the right of the bat a bit, say, 40 pixels to the right, we get this:
direction=90-(40-0);

Which ends up as
direction=50; Which is angled to the right, and up.

If the ball is to the left of the bat, we get.. well, you get the idea!

So it isn't perfect, for longer bats, you may want to change it to something like this:
direction=90-((x-other.x)/2);

The other part of the code refers the the other object in the collision(in this case, the bat.)
  • 0

#11 howabout

howabout

    GMC Member

  • GMC Member
  • 99 posts

Posted 27 February 2012 - 01:41 AM

The first bit here:

while(place_meeting(x,y,other))
{
    y-=1;
}


simply moves the the ball 'up' so that it no longer collides with the bat. So it moves up 1 pixel, checks, still colliding, move up again, etc.

We don't want the bat, or ball to be solid (if they are, they automatically move outside each other). And using a function like move_outside_all the ball might end up beneath the bat.. or colliding with someother object.

The next bit:
direction=90-(x-other.x);

Is what we use to determine our direction.

If we center your bat sprite, then the bat x is the middle of the bat, and the ball x is the middle of the ball.

If the ball bounes directly in the middle of the bat, we get something like this:

direction=90-(0-0);

Which is, direction=90. Which is straight up!

If the ball is to the right of the bat a bit, say, 40 pixels to the right, we get this:
direction=90-(40-0);

Which ends up as
direction=50; Which is angled to the right, and up.

If the ball is to the left of the bat, we get.. well, you get the idea!

So it isn't perfect, for longer bats, you may want to change it to something like this:
direction=90-((x-other.x)/2);

The other part of the code refers the the other object in the collision(in this case, the bat.)

Oh! That makes sense. You know what sucks? When I made the projection, I made it sideways because I stupidly didnt think of just making the width 480 and the heigh 640 :S. But it gets you thinking when you draw models or when you want to do most other movements :D.
  • 0

#12 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 27 February 2012 - 02:01 AM

Oh, right. :P In fact case, you'd use the same code, only use the y element!
  • 0

#13 howabout

howabout

    GMC Member

  • GMC Member
  • 99 posts

Posted 27 February 2012 - 02:15 AM

Oh, right. :P In fact case, you'd use the same code, only use the y element!

I have come across a problem. That code makes it so that it goes to the left at all times. I even tried adding your paddle movement code and it still doesnt work... What am I doing wrong? I changed the y-=1 to x-=1 and the direction x and x to y and y and its not working :S.
  • 0

#14 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 27 February 2012 - 02:44 AM

-Make sure the ball and bat's origins are centered.

-Change the 90 to either 0, or 180.

(90 is straight up. 0 is direction to the right. And 180 is direction to the left horizontally.

If your bat is on the right side of the screen, you'd want 180.
  • 0

#15 howabout

howabout

    GMC Member

  • GMC Member
  • 99 posts

Posted 27 February 2012 - 03:40 AM

WOW! Thank you so SO SO SO SO MUCH desert dog. You have helped me so much. And when I said your game sucked, I meant that it sucked on the iOS version so I automaticly assumed it would also suck on the PC version. But it doesnt :) Im working on power ups right now. Ill post an update soon :)
  • 0

#16 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 27 February 2012 - 03:52 AM

Haha, o.k. :tongue:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users