Page 2 of 2

Re: Break out clone.

Posted: Fri Feb 25, 2011 10:52 pm
by kikito
Hi there Chris!

I'm glad you liked middleclass. I'm doing my best to make it useful!

Regarding the sound problems, give TESound a try. I haven't tried it myself, but I've read its code and it should solve your problem.

Twh

I also think it should be windowed mode at the start. In my case, the volume was ultra-high when I started the game. The music was too loud! I had to turn the game off just to turn the main volume down.

Also, a minor thing: you will probably want to set the cursor to the center of the screen at the start. It took me some seconds to realize that I had to move the mouse, because I didn't see any cursor (was on the lower-right screen at the start for me)

But those are minor things. I liked your game - it's very solid. I enjoyed the hand-drawn art and the strange music fits in nicely (once I could turn the volume down to decent levels :P).

Good job!

Re: Break out clone.

Posted: Sat Feb 26, 2011 2:31 pm
by chris
I'm currently working on the game :P I allready made escape go to the menu, in the menu I added a quit button and a fullscreen button. Standard mode is windowed now. Also implented TEsound although I allready came up with a solution myself. The playlist function will be handy when I have more soundtracks.

But before I'll upload the new version, can someone tell me what is wrong with this code:

Code: Select all

local x
for x in pairs(bricks) do
local y
for y in pairs(ballball) do
if ballball[y].box:collidesWith(bricks[x].box) then
ballball[y]:bounce(bricks[x].xx,bricks[x].yy)
bricks[x]:doStuff()
table.remove(bricks,x)
end
end
end
It causes this error:
play.lua: 100: attempt to index field '?' (a nil value)

I'm currently replacing all ballball code with a ballball table. Because I want to add multiple balls. I allready made a brick, if I hit that brick there's a 'get another ball' item created, if hit that item, I get another ball, then I can play for some time with two balls (very cool btw.) but ... after some time that error from above pops up. cant really figure it out whats wrong.. :/

--edit
Solved allready. Simple logical problem (tried to detect collision with other ball after brick was allready destroyed..)

Re: Break out clone.

Posted: Sat Feb 26, 2011 4:13 pm
by EMB
Just for future reference, when giving us an error with a line number but only giving us part of the code, TELL US WHAT LINE IT CORRESPONDS TO!

Re: Break out clone.

Posted: Sat Feb 26, 2011 4:22 pm
by tentus
I'm a little in the dark as to what you're trying to do. Is this an equivalent statement?

Code: Select all

for x=1, #bricks do
	for y=1, #ballball do
		if ballball[y].box:collidesWith(bricks[x].box) then
			ballball[y]:bounce(bricks[x].xx,bricks[x].yy)
			bricks[x]:doStuff()
			table.remove(bricks,x)
		end
	end
end
Also, as EMB said, a line number would be helpful. Generally the more code you show us the better, actually.

Re: Break out clone.

Posted: Sat Feb 26, 2011 4:33 pm
by nevon
tentus wrote:I'm a little in the dark as to what you're trying to do. Is this an equivalent statement?

Code: Select all

for x=1, #bricks do
	for y=1, #ballball do
		if ballball[y].box:collidesWith(bricks[x].box) then
			ballball[y]:bounce(bricks[x].xx,bricks[x].yy)
			bricks[x]:doStuff()
			table.remove(bricks,x)
		end
	end
end
Also, as EMB said, a line number would be helpful. Generally the more code you show us the better, actually.
The problem has been solved already. (S)he was removing bricks while in the loop, so if ball #1 and ball #2 both hit the same brick, it will crash in the second iteration of the inner loop.

Re: Break out clone.

Posted: Tue Mar 01, 2011 12:47 am
by Jasoco
Very nice demo. But I will suggest one thing, the ball needs to gain speed or lose speed or change angles depending on where it hits the paddle or how hard you hit it (How fast you are moving it when the ball hits it) like other Breakout games. Seems right now it always moves the same speed and only moves at 45º angles.

For changing the angle, make it so the closer to the middle of the paddle you hit, the smaller (More straight up) the ball will bounce. And closer to the edge would be a wider (More straight out) angle.

Re: Break out clone.

Posted: Tue Mar 01, 2011 9:09 am
by StoneCrow
solid demo, liked the quirky art and music style
all the comments above are solid advice though, goodluck :megagrin:

Re: Break out clone.

Posted: Tue Mar 01, 2011 9:57 am
by crow
Ball is still going under the tab sometimes but still will bounce back up happend about 3 times also the level 2 text for me was hanging down in some default
looking font looks little out of place but thats just miner nice demo.

Re: Break out clone.

Posted: Tue Mar 01, 2011 3:56 pm
by chris
The problem about changing how the ball bounces is that the whole game design is made with this simple movement in mind. Changing the code will be a lot of work, dont know if I'm going to do that for this game. I allready had a lot of work making the code work in a way I could add another ball.

I've actually allready realised most tips, but I'll wait with uploading the new version untill I have some more changes.