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 with some basics

Author
Message
CalliahS
18
Years of Service
User Offline
Joined: 30th Mar 2006
Location:
Posted: 6th Apr 2006 17:46
Hey everyone,
I'm fooling around with DBC, and I decided to try something out. I have a circle at the bottom of the screen, that can only go up to a certain extent. I got that with working after a little while, with no problems. Now I want the circle to shoot a bar when the spacebar is pressed. I got that to happen, but it only worked once per execution. So, I added the attack=0 or 1 part to take care of that. I wanted it to be able to shoot faster, so I tried using an array. Now I can't figure out what I'm doing wrong. I know that I'm probably missing something very basic, so if someone could help me out, it would be greatly appreciated.




Calliah
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 6th Apr 2006 21:12
your for loop under attack is wrong. You have

for n=1 to n

n is equal to 1 in the top of your program. so this for loop will only execute once.

basically that line of code is saying for n=1 to 1

Thus count will never increment to 50 and attack will never get set to 0. This will prevent the attack code from ever being called again.

You also never intialized count, but basic will usially set it to 0.

I am guessing that you meant to use a variable other than n in you code above.

Login to post a reply

Server time is: 2024-09-24 19:29:39
Your offset time is: 2024-09-24 19:29:39