PDA

View Full Version : Arkanoid



Simone
29-05-2008, 14:45
Hi all,

I'm trying to make a engine for create maps for arkanoid.
I have taken over the method of Petr for Labyrinth script. ;D

Ciao,
Simone

PS: Fixed end function
PS: New version with Petr Change and little mod of "life" of Bricks
PS: Version with a chance to create paddle and ball in level files 06-05-2008

06/12/2008 first Version with bonuses

Petr Schreiber
29-05-2008, 16:35
Hi Simone,

what a nice surprise!
It looks very good, I am sure it will be perfect base for further work on Arkanoid project.
I like the code too, only on the last line you have one END FUNCTION "redundant".


Thanks,
Petr

P.S. I re-downloaded latest Labyrinth and there was some problem with parenthesis, I uploaded new hot fix

ErosOlmi
29-05-2008, 17:28
--Simone
Thanks !!!

--Petr
huuu, I need to add a check for FUNCTION/END FUCNTION pairs.
Nice level :D

Simone
29-05-2008, 17:43
Hi Petr,

Thanks!! Nice level! :D
I updated the script without the double-end function in the first post.

now I'm working on the properties of the blocks as the life and material which are made.

Ciao
Simone

Petr Schreiber
29-05-2008, 18:38
Great idea!,

the info about type of brick can be stored in entity using TBGL_EntitySetUserData ;)


Thanks,
Petr

kryton9
29-05-2008, 19:20
What a nice surprise to wake up to. Thanks Simone!

Petr Schreiber
01-06-2008, 16:18
Hi Simone,

just a little modification of your code :)

There is a paddle you can move with mouse, use left mouse button to fire the ball.

When the bricks are hit they do not disappear, but fly away.

Few ideas for future, to better differentiate this proggie from other numerous clones:

Using circles instead of bricks => better variety of bouncing angles
Make paddle not move on straight line, but on circle around the block shape



Thanks,
Petr

kryton9
01-06-2008, 23:25
This could also be a good source to launch Scrubbles thinBasic version too.
Sounds like a good project for you guys: Petr, Simone and Abraxas.

Simone
03-06-2008, 09:12
Hi Petr,

Thanks for your help and your suggestion. :)

I was studying a way to create a cracks on the bricks when they are hit and then make them explode.
Beatiful idea to move the paddle around the block shape i will try to realize it.

For the explosion of bricks i was watching at the script TBGL_TopDown3D_ExplodeStudy. Do you think it's a good idea to implement it in arkanoid ?

Thanks,
Ciao
Simone

Petr Schreiber
03-06-2008, 10:00
Hi Simone,

I think the way used in script you mentioned would be usable.
But it is older script, TBGL now provides some mechanisms to speed the thing up, so I will prepair new version for you in few days.

Idea with cracking bricks to parts is excellent. As bricks are pretty simple shape, it could be done each time differentely ( original box entity would be hidden, and few m15 models would be created on the fly, for each explosion differentely, lets go next gen :) ).


Thanks,
Petr

ErosOlmi
03-06-2008, 13:15
Petr,

thanks a lot for this fantastic version that is almost complete and playable.

Simone, something I found I would like to improve:

ball direction is almost 45 degree and I found some circumstances where I enetered in a loop: ball always moving on the same path and no way to change it with a paddle effect.
I think direction of the ball should consider the paddle movements (when hitting the ball, the paddle was comeing from left or right? what was the relative speed?, ..) in order to give the ball some effect.
also the ball should be an element defined inside the level file. Ball can bea sphere or an object of bigger shape in case of bonus
bonus: some brick can be a bonus discover. There can be some predetermined kind of bonus like:

transform the paddle into a cannon for x seconds
use more than one ball
reduce paddle size
increase paddle size



In next thinBasic I will work on the possibility to add new functions dynamically during script execution. This should help in adding dynamic bonus.

Ciao
Eros

Petr Schreiber
03-06-2008, 14:58
Poor Simone,

reason for almost all complaints were caused by my mod :D I just wanted to put together quick concept.

I think we should invent complete game design and then start to code, else we will risk big rewrites.
Good idea with bonus tiles, and very promising are that dynamic functions, cool!


Petr

ErosOlmi
03-06-2008, 15:01
Do not worry about Simone.
He gives is best when under pressure ;D I know for sure !!!!

And, hey!!! My post was not a complain but wishes.

ErosOlmi
03-06-2008, 15:03
I think we should invent complete game design and then start to code, else we will risk big rewrites.


Good programmers know what their "customers" want even if "customers" do not say what they want.
So I hope Simone already read my mind since the beginning.
;D ;D

Simone
03-06-2008, 16:08
don't worry Petr,
I must thanks you and Eros for your ideas and changes ;)

I agree with you regarding bonuses that will make the script more fun.
I think the best thing is to give at the creator of the level the opportunity to choose which bonus assign at the some bricks.

Simone

Simone
03-06-2008, 18:55
Before moving to study a complete arkanoid project,
I have updated the script in the first post with the changes of petr and added a small change with the management of "life" of blocks :).

Ciao,
Simone

Petr Schreiber
03-06-2008, 20:22
Thanks Simone,

new version with more resistant bricks is good - just needs some "cloud of dust" or something to let player now it is being damaged ( or add little cracks on surface ?). I will think about way to do it.


Petr

kryton9
03-06-2008, 22:57
Arkanoid 3d is very nice, fun to watch the bricks fall off into the distance.
Nice to see the quick progression you guys have made!

ErosOlmi
05-06-2008, 06:24
This script has now its own forum.

Simone
05-06-2008, 17:48
Hi,

I updated the first post with a new small version.
I'm still working on the cracks for now when you hit the bricks they unload texture ;D

-- Ability to create the paddle and the ball with the file level
-- Parameterized variables of paddle and ball

I was working on the possibility to load the paddle as a model m15 but I can not find a way to capture the length and height of the model paddle.
I thought to do with tbgl_pointinside3d

I think that in the new version i be able to implement bonuses :)

Ciao,
Simone

Petr Schreiber
05-06-2008, 17:57
Hi Simone,

to get model width/height you can use following SUB:


sub Model_GetWidthHeight( model as long, byref width as double, byref height as double )
local i as long
local x, y as double
local minx as double = 1000
local miny as double = 1000
local maxx as double =-1000
local maxy as double =-1000

for i = 1 to tbgl_m15GetModelVertexcount(model)

x = tbgl_m15GetVertexX(model, i)
y = tbgl_m15GetVertexY(model, i)

minx = min(x, minx)
miny = min(y, miny)

maxx = max(x, maxx)
maxy = max(y, maxy)

next

width = maxx - minx
height = maxy - miny

end sub


You just pass model slot, and two variables BYREF.


Petr

ErosOlmi
05-06-2008, 18:01
Petr,

this is perfect for a new M15 native function, isn't it?
;)

Eros

Petr Schreiber
05-06-2008, 18:04
One more thing,

Patrice Terrier had nice suggestion for his BassBox player, which we can apply too.
Currently, game uses almost 100% CPU, but if you put:


sleep 10


... on the line right after center cursor, we get 2 cool things:

Process will use 0 to 6% of CPU, while still open to run at 100 FPS
Mouse input will work better


Eros, your wish is my command ;D. I will make it in way it will return even the z size.


Bye and thanks a lot for new version!,
Petr

Simone
05-06-2008, 18:08
thank you very much Petr, ;)
tonight I try to implement it in the script and manage models of paddle.

Simone

kryton9
05-06-2008, 18:16
Simone thanks for the update. Good luck on next version... excited to see it when it is out!

Petr Schreiber
05-06-2008, 20:58
Hi Simone,

I developed function TBGL_m15GetModelDimensions, which could be used for the job. You will find it in next thinBASIC release.


Petr

kryton9
05-06-2008, 22:03
Very much needed and appreciated function, Petr

Simone
05-06-2008, 23:30
thanks petr, your suggestion for calculate the width and height of a model, works very well. :D
I'm wait the new thinbasic version for try the new feature.

Simone

Simone
12-06-2008, 12:37
Hi,

I have update the first post with new version of Arkanoid.
Where there is a first test of bonuses.
The bonuses in the script for now are two:
- change the width of paddle;
- possibility of multi ball.

I hope it is the right way to take.

Ciao,
Simone

Petr Schreiber
12-06-2008, 14:39
Simone!,

that is very nice version! And I see you prepared a lot for future - model size check is there.
My favourite bonus is multiball, it really doubles the fun.


Petr

Michael Hartlef
12-06-2008, 19:06
Hi Simone,

it looks promising. Here are some odd things I discovered:

1) Paddle movement with an optical mouse. Sometimes not very accurate.
2) A straight ball up bounce in a random angle back after it hit a brick. Very unusual behaviour for a blockbuster game
3) Sometimes the ball changes its direction when on the left in the black area. Like it is hitting an invisible brick.

Thanks for sharing the script.

Michael

ErosOlmi
12-06-2008, 23:14
The following should improve a bit the way balls hits paddle.

Inside "Ball_CheckMovement" sub, substitute the follwing line

vball(count_ball-%eBall+1).directionLR = rndf(-1,1)
with the following:

vball(count_ball-%eBall+1).directionLR = (bx - px)/(paddle.width/2)
The above create an incidence angle (positive or negative) proportional with the position in where the ball hit the paddle.

Still to improve the way balls hit bricks or external walls.

Ciao
Eros

kryton9
13-06-2008, 02:35
Simone it is really progressing quickly and nicely, thanks!

I miss the bricks floating away :)