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 / A few annoyances in my code. Need some assistance.

Author
Message
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 6th Oct 2004 07:11
Hi!

I have been workin hard to try and re-arrange my code so that I can add more levels easily. The first thing I did, was move everything pertaining to the first level, out of the main loop and into a subroutine titled appropriately, level1. Now before doing this a few things worked that now do not. The most major of these things is the fact that the second wave of enemy objects (100 to 150) will not move when contacting objects 204 to 206, now as you will see in the code, there is a function to do this for objects 5 to 16, but when I try and copy it to work with object 100 to 150, I get a few errors, mainly dealing with arrays being called out of bounds.
Now, problem number 2 is less annoying, but is a huge gameplay flaw at the moment, the player can move around any of the objects after the first timer has expired, and practically eliminate the enemy by doing this, once the first timer has expired the player should not be able to move the objects, or the objects collision should be turned off while they are moving. Here is the code.....



Thanks

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 8th Oct 2004 10:01
Please help someone.

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 8th Oct 2004 11:16 Edited at: 8th Oct 2004 11:16
hmm... that was an odd little thing... took me a while to figure out what was going on exactly

I don't know about your 1st question (yet) but as far as question #2 goes, you have in your code:

if timeleft(0) => 0
gosub selection
endif

delete the = and it'll work like you want it.

something
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 8th Oct 2004 12:09
Hey Thanks! I would have never seen that, a good eye you have , Well one question down, 1 to go. I have been trying to copy the collision detection rule for objects 6 to 15, but when I adapt that code to work with objects 100 to 150 I get some ugly array problems, I really need help with that question, as it's a seriouse issue.

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 8th Oct 2004 13:24
Ah... found the problem. When you copy the code, your not changing dim mover() to have at least 150.

I'm assuming you talking about this:



if that's not what your trying to do, then I must have missed it.

something
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 9th Oct 2004 09:31
Thanks, but when I stick that in my code, I still get an "array accesed out of bounds". So I am confused again

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 11th Oct 2004 02:37
Quote: " Ah... found the problem. When you copy the code, your not changing dim mover() to have at least 150."


can you expain how to do this? I'm confused, and the problem remains.

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 11th Oct 2004 08:41
Bump, please sombody?

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 11th Oct 2004 12:26
This code works fine for me, with no errors.



what I was talking about before, was when you create the array called "mover()" (line 15 in the above code) that you didn't have enough slots in it for you to be able to copy the other bit of code to work with objects 100 to 150.

Hopefully that makes more sense...

something
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 11th Oct 2004 12:57
Thank you,the code works now, but I have encountered a bit of a bug, a few of the objects from the 2nd wave of enemys is not detecting collision against the big white barrers, they simply pass through them. Any suggestions?

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 11th Oct 2004 13:06
Make sure that you are checking for collision between the all of the second wave of enemies and the white barriers.

something

Login to post a reply

Server time is: 2025-05-24 19:34:16
Your offset time is: 2025-05-24 19:34:16