Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / DarkNOOBS Project 4: Breakout

Author
Message
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 23rd Jul 2009 23:32 Edited at: 23rd Jul 2009 23:48
ok ive almost got the level editor finished, but i need to know something

if you open a file to read, close it, then open it again, does it start the reading at the beginning or where you left off previously?

ok i sorta lied, the editor is finished (still no fancy GUI but it is functional and can export up to 10 levels per file) but the main game is having trouble switching between levels

edit:

nvm, i did a test and every time you load it, it starts back at the beginnin, gimme another few minutes and i should have the game ready for multiple levels, working out a troublesome bug at the moment

Dark Dragon
16
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 23rd Jul 2009 23:50
Quote: "if you open a file to read, close it, then open it again, does it start the reading at the beginning or where you left off previously?"


once you close it, open it again and you must read from the begining.

Your signature has been erased by a mod because it was too big.CHANGE IT OR DIE!!!!!
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 24th Jul 2009 00:00
apparently u missed the edit.......

That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 24th Jul 2009 00:15 Edited at: 24th Jul 2009 00:15
ok sorry for dp but this is a fairly important post

YYYYYAAAAAAAAAAAAYYYYYYYYYYY!!!!

the level editor is complete and working, the controls are:



a simple sample level is included (just to showcase multiple levels)

the only flaw in my opinion is that you cant load levels (i may fix this later but as for now im done on it)

all you have to do to make your own level(s) is delete the levels.txt file, run the editor, make your level(s), hit enter, close the editor and run the main game

Dark Dragon
16
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 24th Jul 2009 00:23 Edited at: 24th Jul 2009 00:24
YAY! (Lol)

I'll test it now.

*looks at first post*

Your signature has been erased by a mod because it was too big.CHANGE IT OR DIE!!!!!
Brick Break
User Banned
Posted: 24th Jul 2009 00:54
I tried out the newest demo, and decided you needed some more artwork. You know what to do with this.

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!

Attachments

Login to view attachments
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 24th Jul 2009 00:58
cool BB, would be even better if it had the grid built into it, either u can do it or i can, if u do it just make sure to have the grid be just like the one in the program

Brick Break
User Banned
Posted: 24th Jul 2009 01:04
Grid? This is supposed to be what you see ingame.

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 24th Jul 2009 02:02
u mean in the main game or the editor?

in the main game I think we're fine, thats basically what we have only the score bar is gradient, which wont work anyway cuz the score is a sprite, so that black will show between the letter, which we dont want (at least i dont)

Brick Break
User Banned
Posted: 24th Jul 2009 02:13
Just try it.

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 24th Jul 2009 02:44
ok

That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 24th Jul 2009 23:23
ok i implemented the image into the game, resized the grid on the editor (it could fit one more column of bricks on the right) and made the ball stuck to paddle mechanic

but i dont feel like ive really added enough to constitute an update, so what else do you guys want to see in the game?

Brick Break
User Banned
Posted: 24th Jul 2009 23:57
The ball should bounce off of the paddle in different directions depending on where it hits.

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Jul 2009 00:13
indeed it should, ill start working on that, but ill need u to whip up a new paddle, a rounded one to make it look right

That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Jul 2009 19:15
ok im almost ready for an update, just squashing the last indestructible brick bug

how comes the rounded paddle image BB?

That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Jul 2009 20:35 Edited at: 25th Jul 2009 20:36
ok the update is posted, major improvements being:



next on my agenda:



images I need, either made by me or BB:




from irojo I need:




I was thinking maybe a fire ball powerup for now, makes the ball go through standard bricks without bouncing and deals double damage to 2-hit and 3-hit bricks

Irojo
15
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 26th Jul 2009 17:36 Edited at: 27th Jul 2009 00:16
Ooooo sounds! I like that assignment.


Time is money. I just ripped you off.
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 26th Jul 2009 21:22
ok irojo's music is workin (sounds quite good to I maight add) and I am quite proud of my Instructions menu, its saved as a .txt file and is set up so that if near the end of a line there is a ~ character followed by a number, it will paste the image of that number

however again I dont feel like ive done enough to constitute an update

Irojo
15
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 27th Jul 2009 00:17
Quote: "sounds quite good"

Thanks.

I have to leave for 2 hours or so, and am not sure if I will be able to make/upload the sound effects. Just so you know, but I intend to have them finished within 24 hours.


Time is money. I just ripped you off.
Brick Break
User Banned
Posted: 27th Jul 2009 03:05 Edited at: 27th Jul 2009 03:21
The reason I couldn't do anything was because I was on vacation for a couple days. I'll try to do your sprites now.

EDIT: Attached!

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!

Attachments

Login to view attachments
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Jul 2009 03:56
alright thanks, glass brick looks nice

but what about the rounded paddle?

not to rush you, just saying we still need it

Brick Break
User Banned
Posted: 27th Jul 2009 04:25
I included a new paddle image. How much detail can you expect to squeeze into 80x8?

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Jul 2009 04:38 Edited at: 27th Jul 2009 04:40
u did?

..... hold on ill download it again

edit:

thats not rounded at all, u sure u put the right image into the zip?

Brick Break
User Banned
Posted: 27th Jul 2009 05:16
I'm sure. It's just as rounded as the old one. Here, I'll attach a larger version. Maybe this is what you're looking for.

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!

Attachments

Login to view attachments
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Jul 2009 05:47
yeah thats the same one I have, maybe i wasnt clear on what I wanted, I wanted a paddle that looks almost like half an oval, something that when you hit it, it looks like it SHOULD bounce off at an angle, instead of 90 degrees

I know in the old breakout games they used a flat paddle, but that just always looked weird to me, like if you came from the top left corner and hit the left side, you would think it would go up and to the right, but instead it went straight up or even back to the left

are you understanding what im asking?

Brick Break
User Banned
Posted: 27th Jul 2009 05:57 Edited at: 27th Jul 2009 06:04
Oh, OK. Well, it would look kind of weird, but I'll give it a shot.

EDIT: OK, that was easy. Just go into paint and make an oval, then antialias it a little. File attached.

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!

Attachments

Login to view attachments
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Jul 2009 06:12
it wouldnt look weird, not from my opinion anyway, let me give you soem math visuals:

if 0 degrees represents straight up, and 90 degrees represents to the right, then picture the scene:

a ball comes in with it angle being 150 (2/3 of the way from right to down) and hits a perfect semi-circle at a point 330 degrees form the center (1/3 of way from top to left)

would it make more sense for the ball to go off with angle of 30 (as it would against a flat paddle) or bounce back off with angle of 315 degrees?

this picture should explain:

Attachments

Login to view attachments
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Jul 2009 06:13
u and I were typing same time, the half an oval in my picture is basically what I want, thanks for all te effort you've shown though

Irojo
15
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 27th Jul 2009 17:26
Okay here goes trying to upload the regular file sound effect. Please post immediatly if you successfully download it. You don't even have to be part of the project .


Time is money. I just ripped you off.

Attachments

Login to view attachments
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Jul 2009 18:37 Edited at: 27th Jul 2009 18:42
if they arent the right file type, dnot worry, I have audacity so I can change em

edit:

I like that one, but I think it sounds a little too metallic for the standard brick so I think ill use that as the golden brick hit

Brick Break
User Banned
Posted: 27th Jul 2009 20:36
Here's your rounded paddle.

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!

Attachments

Login to view attachments
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Jul 2009 20:48 Edited at: 27th Jul 2009 20:54
DING DING DING, we have a winner!!!!

what are the dimmensions on that though?

edit:

i took your image and scaled it down to 80*20, i should be posting an update later today once I get the new bounce mechanic working

Brick Break
User Banned
Posted: 27th Jul 2009 21:00


WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Jul 2009 21:23
roflmao!!!!

Brick Break
User Banned
Posted: 27th Jul 2009 21:28
[/comedy]When do you plan to have the new bounce mechanic working? I'm looking forward to that update.

WINNER list:
Latch, Lee Bamber, TDK, TheComet
Thanks for the help!
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Jul 2009 22:29
sometime later today, no guarantees when exactly though other than that it will be before midnight tonight

That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 28th Jul 2009 01:27
ok new update!!!!!!!!!1111!!!!


main features are:

music is in place (no sounds yet though, ill add those onc eI get all 3)

glass bricks are fully functioning in both the editor and the game

instructions are saved onto a .txt file

new paddle image is working

the ball is now free flying, it can go in theoretically any direction!!!!!


ps:

man that was a pain, do u know how annoying it is to try and track down EVERY use of the variables ballx,bally,ballmovex, and ballmovey and stick a # at the end, ITS VERY IRRATATING!!!

pss:

just realized I have one more minor thing to do to make the new paddle collision "realistic", it looks good now but the math isnt exactly right, ill have to do that next update

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 28th Jul 2009 01:35
Quote: "is to try and track down EVERY use of t"


Isn't there a FIND option and a REPLACE ALL option as well in the editor? Probably could have made things a little easier.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 28th Jul 2009 01:43
.........u hear that loud BANG, thats me shooting myself......

lol, i used the find option but never saw the replace all button, and since the find just checks for the first instance of it, I couldnt use that alone to cycle through the entire document

so what do you think of the new game bn2?

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 28th Jul 2009 01:45
haven't had a chance to try it out yet, kinda tied up with the indie game competition (my team is almost full at 5 people). I will however try it out tonight after work.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 28th Jul 2009 02:01
its quite impressive if I do say so myself, especially the simple and working editor

also could u kinda give me tips on how to make my paddle collision "realistic", since you are the physics major

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 28th Jul 2009 07:48
lol, its mechanical engineering major to be specific, but yes, I will give you some pointers once I see where it is at

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 28th Jul 2009 08:26
Nice job guys.

Here is how I would suggest the physics works with the paddle. Note that this uses mainly math and to understand will require knowledge of vectors.

Basics:
1. All Vectors can be split into components. Often times these are 90 degress from each other (not always but usually).

2.A balls velocity is none other than the vector with components of the balls movement in the X and Y directions

3.These components, while correct, aren't what we would want (why in a second).

4.Using some geometry and trig we can find the new components in a more useful direction.


Tutorial: Bouncing Physics off of an Ellipse.

The ellipse we are working with has a width of 80 and a total height of 38. Its radii are 40 in the X direction and 19 in the Y direction.

The equations for an ellipse are as follows:
Y=CenterY+YRadius*Sin(angle)
X=CenterX+XRadius*Cos(Angle)

The first step after collision is to find the angle from the center of the paddle to the center of the ball using atanfull().

Angle#=ATANFULL(BallX-CenterX,BallY-CenterY)

Second is to find the angle which the ball is traveling at and its magnitude (strength) like so:

BallAngle#=ATANFULL(BallMoveX#,BallMoveY#)
BallMagnitude#=SQRT(BallMoveX#^2+BallMoveY#)

The third step is to set up a 'new' coordinate axis, using the angle# angle as the x axis. This is more of a mental step, but necessary.

Next, you want to break the balls movement into components along this new axis and it's Y axis.

NewBallAngle#=BallAngle#-Angle#
NewBallX#=BallMagnitude#*Cos(NewBallAngle#)
NewBallY#=BallMagnitude#*Sin(NewBallAngle#)

The X direction is simply going to be flipped (due to the normal force).

NewBallX#=NewBallX#*(-1)

Recombine the NewBallX# and NewBallY# into a magnitude and angle by doing the same stuff backwards (For the sake of laziness I will begin reusing variable names):

BallMagnitude#=SQRT(NewBallX#^2+NewBallY#^2)
BallAngle#=ATANFULL(NewBallX#,NewBallY#)
RealAngle#=BallAngle#+Angle# : REM This is the original Angle# variable)
BallMoveX#=BallMagnitude#*Cos(RealAngle#)
BallMoveY#=BallMagnitude#*Sin(RealAngle#)


Viola! I will try to draw up some pics to help illustrate it if you want, don't know if I will be able to get em up tonight though. Let me know if I can clarify anything. If you are having trouble picturing it, try to follow the math with a ball hitting the very top dropping straight down (it would bounce straight back up).

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 28th Jul 2009 17:30
ok cool, im gona have to read through it a few times to understand it but cool

two things though, are we really concerned with altering the balls magnitude? i know in real physics you would be, but for this I dont believe its needed (although I have been wrong in the past)

2:
Quote: "BallMagnitude#=SQRT(BallMoveX#^2+BallMoveY#)"

shouldnt ballmovey# also be squared? (again we may not need this but just to ensure accurate info)

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 28th Jul 2009 22:04
Yeah it does, my bad, I was tired.

Technically speaking, it ISN'T altered. However, you need it so that you can break it into components in the new coordinate system you set up.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 28th Jul 2009 22:51
np, also is newballx and newbally the movements or the actual coords?

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 28th Jul 2009 23:05
movements, sorry

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 28th Jul 2009 23:36
ok i tried to do that, this is what I ended up with:



under the check_collision subroutine, replace case 3 with that and as you will see, the collision is all messed up

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 28th Jul 2009 23:38
Remember, this is what to do once the ball has been established as collided. There is no collision check built into this method.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 28th Jul 2009 23:41
right the collision checks (theres 2) are at the top of the subroutine and before the label to it

Login to post a reply

Server time is: 2024-05-20 09:48:17
Your offset time is: 2024-05-20 09:48:17