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 / Ahh, battle system again, please help!

Author
Message
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 25th Nov 2002 04:34
Why isnt this code working? Its everything to do with the sprite;


Everything from if keystate(28)=1 then gosub items:
down.

Please Help!
RPGamer
Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
Puffy
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 25th Nov 2002 08:28
first you dont need to say if keystate again thats sloppy(you only need it because you put the gosub in the while loop)... 2 why is the gosub in your while loop... 3 why are you loading a bitmap in the gosub loading files lags big time in a loop... =\ hrmm i notice that you delete the sprite but you could just show and hide it... =\ load before hand... it might be one of those things... thats all that i see is wrong...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/2.5mbs Sat Con... I joined in!
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 25th Nov 2002 11:49
You cannot use "Gosub Items:"....
You have to leave out the colon ( when using goto or gosub...

AND the sub shoul be outside the while-endwhile loop. Else it would be executed once every loop and twice every time you press key nr 28.

This is your code in fixed version: (have not testet)


TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 25th Nov 2002 11:50
Hmm. that smiley was not what i meant.. It should have been (":")

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 25th Nov 2002 23:14
Hmm, still a problem. It must be in the While statement, or else you will be able to go to the menu whenever enter is pressed. now this would be just fine, except when you want to attack, you dont want an items menu coming up!

If you have ever played the Equilibrium combat demo, this would be like what I mean.

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 25th Nov 2002 23:48
I think I may compremise by having the same size menu come up every time, oh well, fine for now.

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
Puffy
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 26th Nov 2002 07:09
hehe... thats a lazy thing to do... just like not fixing a speed bump in your code and just using "fastsync"

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/2.5mbs Sat Con... I joined in!
KNau
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: Canada
Posted: 26th Nov 2002 12:20
You really shouldn't have a subroutine within your WHILE / ENDWHILE loop. Stick it out of the way at the end of your program.

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 26th Nov 2002 13:44
I need to have it during a WHILE or else the thing will come up WHENVER you press enter. See here, I have different size menus for magic and attack, and they are in differnet places. I need to have them come up WHILE at the position of attack on the menu!

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 26th Nov 2002 13:54
Are you sure you did not want to use Repeat-Until loop instead of the While-EndWhile.
i.e:
Repeat
blah..blah..blah..
Until ypos=580

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
Puffy
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 26th Nov 2002 17:12
the mans got a point...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/2.5mbs Sat Con... I joined in!
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 27th Nov 2002 03:47
Tried that lol

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
Puffy
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 27th Nov 2002 11:35
=\ why do you even need the gosub again... why not just remove it and test...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Puffy
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 27th Nov 2002 11:35
or nested if statements

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!

Login to post a reply

Server time is: 2024-03-28 13:44:15
Your offset time is: 2024-03-28 13:44:15