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 Professional Discussion / Why does it keep saying this command is out of place...

Author
Message
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 25th Mar 2003 03:29 Edited at: 25th Mar 2003 03:30
...when it clearly IS NOT out of place?!



It keeps saying that the ELSE and ENDIF statements are out of place, even though they're working in conjunction with the "If Jumping = 0" line! What the heck is going on?!?!?!

indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 25th Mar 2003 03:39
` If the user is not jumping...
If Jumping = 0



really means


` If the user is not jumping...If Jumping = 0


remove the 3 dots that indicates the grouping of lines perhaps

HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 25th Mar 2003 03:44
Actually indi, thanks, but I figured it out. Come to think of it that might be the problem, but that's wierd! The problem is a stupid one that's out of my control. It's because I had a comment right above the "If jumping = 0", I guess it was those two dots. Hmmm...peculiar

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th Mar 2003 05:52
its the editor recognising commands it shouldn't ... this has happened a few time to me - because you remark a line and add a command like

` if something()=this then somethingelse()
the editor will try to run that like it is part of the code
but you put it like

`if something()=this then somethingelse()
and everything is fine again

some bugs i hope will be squished with the editor v1.1

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 25th Mar 2003 06:28
Me too raven

I have another question. See, now that I have my cheese-it physics and jumping engine working, what would be the west way to make it so that your character doesn't constantly jump if you hold down the control key (which is the jump button in my game)? I want to do some kind of delay so that if I hold down jump, my sprite doesn't stay on the jump frame and bounce of and down like he's made of rubber or something...lol

thank you

Galiem
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United States
Posted: 26th Mar 2003 17:09
Just an idea, and only one way to do it, but try a variable for control.



Galiem
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location: United States
Posted: 26th Mar 2003 17:12
Ack! My kingdom for an edit button!

Should make the line that says "IF Timer2 - Timer = 3000" say instead "IF Timer2 - Timer > 3000". Most likely, it will never exactly equal 3000, and alter the 3000 to whatever time you want the user to have to wait before being able to jump again.

Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Mar 2003 17:46 Edited at: 26th Mar 2003 17:46
there is an edit button... look to the left

that aside



Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Mar 2003 20:12
It's not a bug. The three dots indicate to the editor that the line and the following line should be joined before being passed to the compiler.

If you upgrade your editor from RGT the continuation character has been changed to the uderscore character, and further, is definable by you.
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 26th Mar 2003 23:12
Yes I've gathered that but thank you.

the architect
23
Years of Service
User Offline
Joined: 6th Jan 2003
Location: United Kingdom
Posted: 29th Mar 2003 02:16
I would use a flag eg

if jumpkeypressed = yes and keypressed = 0 then jump: keypressed = 1
if jumpkeypressed <> yes then keypressed = 0




get the idea, eh!

when the jumpkey is pressed the keypressed flag is et to one and will not allow another jump until the jumpkeypressed becomes false.

Or you could keypressed = 20 then dec keypressed but if it drops below 0 make it 0. Thus you get a pause of upto a frame etc

Login to post a reply

Server time is: 2026-07-11 09:47:49
Your offset time is: 2026-07-11 09:47:49