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 / just a few

Author
Message
DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 27th Jan 2008 19:48 Edited at: 27th Jan 2008 19:49
hey guys i have just a few questions, and i have read TDK's collison tutorial but i am still having trouble.

questions:
1. ok im trying to make it so when the player...object 1 comes into contact with object 16
then it ends the program... here is the code i tried

2. if i want to make another level should i use a gosub that runs after the end?

thanks




here is what im planning on using it for.

http://forum.thegamecreators.com/?m=forum_view&t=122806&b=8


Come see the WIP!

Ed222
17
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: Calgary
Posted: 27th Jan 2008 20:01 Edited at: 27th Jan 2008 20:01
for collision you would use


Windows Is better than everything
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jan 2008 23:15
@Newbie
OBJECT HIT works fine but I think it only returns a 1 on the first instance of a collision between two objects.
END will end your program so anything you place after the command wont be executed.


Quote: "2. if i want to make another level should i use a gosub that runs after the end?"

Your wording concerns me, gosubs aren't like pages that you turn to to continue your program, they are like books that you open when you need and when finished put them back on the shelf and continue with your program (a strange metaphor but meh)

It depends what is required to make a level in your game. The main thing is that your game has a central core that can run any level, then you just grab the data you need for the current level.
Tell us more about your game and we might be able to help.

DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 27th Jan 2008 23:18
well what i was planning to do with the gosub...(the end in that if statement was just a placeholder) is when it hits the object which is the object...i will have it rearrange all of the platforms to make the new level...i wont be adding objects just moving them aroun using the position object command.


Come see the WIP!

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Jan 2008 23:32
ah well then your program would look something like this

Of course you'd need lots more code but that's the basic structure.

DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 28th Jan 2008 00:22
exactly...im going to work on lvl 2 tonight it is going to look so confuse on the eyes with all the textures scrolling... its crazy


Come see the WIP!

DB newbie
19
Years of Service
User Offline
Joined: 13th Nov 2005
Location: um..... i dont remember.
Posted: 28th Jan 2008 01:52
ok sweet i made the second level and the gosub worked and everything...but you know how when you use scroll object texture it has to be in the main loop..well i tried it in the gosub because i want the textures to move but it wont work...here is my entire gosub.




Come see the WIP!

Login to post a reply

Server time is: 2025-06-04 02:09:03
Your offset time is: 2025-06-04 02:09:03