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.

Newcomers DBPro Corner / Need Help + pointers (Breakout game 3D)

Author
Message
Redostrike
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Belgium
Posted: 10th Oct 2007 12:07
Hi,

Ok first i want to say that i have my Darkbasic Pro is out of the dust (finally) and i stared to get interested in it again. Now i actually never did much whit it. I just know the basics. I have programmed before in qbasic and visual basic so i know what variables are and arrays and stuff.

Now i want to start off whit a small game, i'm not someone that is willing to write a whole RPG first off, ok i want to create an RPG but first i want to learn a few tricks and tweaks whit other things. Maybe in a year or 2 i could start creating an engine for an RPG while i'm still doing other projects and learning stuff.

Ok now for my questions:

This is what i have a.t.m. it is not much actully some 3D stuff only


It took me a while to get those 2 'walls' there. Now i wanted to ask is should i rather use a matrix and up some walls or can i better continue screwing around whit a third wall. I really dont know anything about collisions a.t.m. so i dont know whats the most easy thing to use for collisions.

Then i would have to think about the 'ball' pshycics i'm really stumbled there anything i could use? i thought about newzvalue but i'm really lost there, the ball needs accel, whit it bounces of the paddle/brick/wall it needs to bounce back the other way and so on. I really need some help here.

Another thing i'm asking myself is should i include all function into my main file or is it better to use one other file for all my functions and declare the variables at the start of my code. Or is it better to set functions of the same type like movment right movment left movment and so on in one file and include it into the code. Then create another file for lets say a level loading function and include it again. I dont know whats the best way. I think it wont be an issue here as i'm prolly not going to have lots of functions here but i'm also asking this for future projects as in an rpg i imagne there are going to be a lot of functions.

anyway thanks for reading and helping me out.

pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 10th Oct 2007 13:13
I suggest it to you.
Make it small,
You bring up a big.

Make it with 2D first.
By the method how it is very easy.

At first.
3D is unnecessary.
A collision is unnecessary.
Physics operation is unnecessary.
A function is unnecessary.
If this was completed,
Improve it.
Redostrike
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Belgium
Posted: 10th Oct 2007 14:02
hmm, i already know the 2D part as i coded lots of 2d games back in the qbasic days i wanted to try darkbasic for the 3d support as i have programmed 2d all my life so i would really love to do this in 3d to learn the benefits + physics.

Eevil Weevil
17
Years of Service
User Offline
Joined: 1st Aug 2007
Location: Wherever you are, I wil follow
Posted: 12th Oct 2007 20:02
To do sum simple ball physics, just use the following code:

Basically, it means that subtracting the direction of the wall (divided by 2) it's just hit from the current direction will make it rotate to face the opposite direction. You could even have it decrease in speed when it hits a wall, by adding in ':dec accel#' after the 'then' statement.
And for moving, just use 'move object'. You could use new(x/y/z)value, or cos/sin, but that tends to be used in stuff like RPGs (I shoudln't've said that ) or JnR, or basically more advanced games where more complex collsion interpolation has to be done, like intersection . Whatever that means...

Excuse me. Yes you. Stop reading my siggy! It is private. Stoppit! Now! I'll kill you! Bleurgh! Go away or I'll format your C-drive! You are dead! I am dead! Yes! Ahem.

Login to post a reply

Server time is: 2024-11-25 12:24:18
Your offset time is: 2024-11-25 12:24:18