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 / breakout won't get started

Author
Message
Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 6th Mar 2006 09:41 Edited at: 6th Mar 2006 09:43
hi. i'm a newb and i've just finished making pong. I'm trying to go on to breakout but i'm having trouble.heres the code


when i run this it makes the first 5 boxes but then says "Runtime Error at line 9. Object does not exist."
Line 9 is the position camera command. I am completly confused, could somone help me?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Mar 2006 09:56 Edited at: 6th Mar 2006 09:56
The error is actually "object already exists". You created 5 cubes then a box with object number 1... which has already been used. Change it to a 6 and it'll work fine.




Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 6th Mar 2006 13:32
hehe thanks man
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 6th Mar 2006 20:05
Np.


Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 8th Mar 2006 10:18 Edited at: 8th Mar 2006 10:20
Ok i've made quite a bit of progress and i've got the ball bouncing around. All i need to do now is to program the squares. The only problem is ive got no idea on how to do this.

PS - I'm using DBC
here's the code i'm using:
Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 9th Mar 2006 11:46
here is my updated cod and i still need help with my collision

Coder#05
18
Years of Service
User Offline
Joined: 26th Oct 2005
Location: Denmark
Posted: 9th Mar 2006 17:04
okay this checks for collision between the ball and every object in your world.. dident had a chance to try it out, so post here if it dont work out for you...


Hope that helped. and sorry if im wrong

Still a noob. easy comes easy goes
Coder#05
18
Years of Service
User Offline
Joined: 26th Oct 2005
Location: Denmark
Posted: 10th Mar 2006 17:13
well did it help?

Still a noob. easy comes easy goes
Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 28th Mar 2006 14:17
sry its taken me so long... i've had to stay after school a lot.
i'm still toying with it right now but i think i might get it finished up soon. Maybe. hopefully
Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 29th Mar 2006 10:38 Edited at: 29th Mar 2006 10:38
ok i've been toying with it and unfortunately i haven't been able to get it work. also i'm having trouble with the death sequence.

Coder#05
18
Years of Service
User Offline
Joined: 26th Oct 2005
Location: Denmark
Posted: 30th Mar 2006 12:50
okay..
object collision(22,10) returns a one(1) if the two objects hit each other.
object collision(22,0) returns the number of the object, that object 22 collides with.
(if you looked in the help files you would know that)
so you need to do two things, first check to see if the ball has collided with one of the briks. 2 then delete the brik that the ball collided with and reverse the ball.

The death sequence:


you make the ball 2 times ,that creates an error, because you already made the object(ball).

the fact is, you dont have to delete the object and then recreate it. you just need to "restart" the balls position variables, ballx# and ballz#.
example:


Hope that helped!
but remember to check out the help files, and search the forum. in most cases you can find the answer. i know that, because thats what i do.
sorry for my bad english








hope that helped

Still a noob. easy comes easy goes
Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 30th Mar 2006 14:32
ya i got the death code figured out before but thanx anyway
Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 1st Apr 2006 15:38 Edited at: 1st Apr 2006 15:46
ok i've done some work on it and now i can get it to delete the cubes. only problem is i get an object does not exist code. here's what i've done-

X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 1st Apr 2006 16:18
try this hope it help


You can do it if you try
Coder#05
18
Years of Service
User Offline
Joined: 26th Oct 2005
Location: Denmark
Posted: 1st Apr 2006 21:16
here this sould work.


keep on coding

Still a noob. easy comes easy goes
Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 2nd Apr 2006 08:31 Edited at: 3rd Apr 2006 12:39
ok first off thank u X MEN and Coder#05 for you help. Second of all i've gotten it to restart and you can win and lose. Problems are-
1.when you restart the cubes come back but i get an error on object already exists (i know i have to do something with object exist and if it does then delete it but i'm not sure how)
2.When i print sumthing it disappears right away
thanks again and heres the code


don't you love that code snippet button?
Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 3rd Apr 2006 15:05 Edited at: 3rd Apr 2006 15:07
Error no. 1 is fixed thankfully. Another error is that sometimes it goes through the paddle and briks which is a no-no.

controls are:
left and right keys move
space restarts it when u lose a life
1 restarts the game when all lives are gone and 2 exits the game

And once again heres the code

Crazy Ninja
19
Years of Service
User Offline
Joined: 27th Aug 2005
Location: Awesometon
Posted: 4th Apr 2006 15:47 Edited at: 4th Apr 2006 15:54
i'm making a new thread with a better version of the game and i'll only be posting stuff there. Thanks for the help so far.

new thread here
http://forum.thegamecreators.com/?m=forum_view&t=75902&b=7

Login to post a reply

Server time is: 2024-09-24 19:27:21
Your offset time is: 2024-09-24 19:27:21