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 / when something isnt pressed

Author
Message
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 26th Sep 2003 21:46
I need help.....Is there an if command that lets me do something if the player doesnt press a button?
eg. if neutral then gosub blah
something like that
anyone?
Andrew
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 26th Sep 2003 21:48 Edited at: 26th Sep 2003 21:52
[/img][img][img]Could help you but i need more details such as.
What do you want the player to do if not pressing anything?





My game will make sure Final Fantasy will never be forgotten.
Remember me because my game will be in the shops in a year or 2.
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 26th Sep 2003 21:50
sorry.
so if the isnt pressing a button on the key board then something happens
like
if (nothingispressed) then gosub blah
ok?
Andrew
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 26th Sep 2003 21:53 Edited at: 26th Sep 2003 21:54
Sorry mate still not with you, what i mean by more details is what do you want the person to do if nothing pressed?
Like walk, run, move etc?
Explain in more detais mate.
Thanks-




My game will make sure Final Fantasy will never be forgotten.
Remember me because my game will be in the shops in a year or 2.
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 26th Sep 2003 21:56
ahh I wanted a certain sprite to be printed on to the screen
like
if (not pressed) then sprite 1,x,y,1
Andrew
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 26th Sep 2003 21:59 Edited at: 26th Sep 2003 21:59
BY looking on what you are saying, you want a gosub if nothing on the keyboard is pressed.
OK a code like this.



Get the idea?




My game will make sure Final Fantasy will never be forgotten.
Remember me because my game will be in the shops in a year or 2.
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 26th Sep 2003 22:00
sorry

cud u not use snippets they dont work for me.
Andrew
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 26th Sep 2003 22:03
Oh you are supposed to click on it But ok here's the code:

Rem person movement
walk=0
run=0
if upkey()=1 then move object file,speed : walk=1
Etc
Now the animations.
if walk=0 then gosub - This means that if the upkey isn't pressed it will go to the gosub

Better?

My game will make sure Final Fantasy will never be forgotten.
Remember me because my game will be in the shops in a year or 2.
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 26th Sep 2003 22:04
i think i get it thanks
Andrew
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 26th Sep 2003 22:05
Ok if you dont please ask me by email: andrewtarrant@fsmail.net

Ok

My game will make sure Final Fantasy will never be forgotten.
Remember me because my game will be in the shops in a year or 2.
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 26th Sep 2003 22:06
well so lets say i want the sprite ship.bmp how wud tht work into it?
Andrew
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 26th Sep 2003 22:14
Well it all depends on why you want the sprite ship.bmp
Ok if you look at the code i gave you, after the gosub place the actual thing that the gosub will go to.
For example.
gosub _sprite_shop

_sprite_ship:
Then you would place the sprite ship.bmp here and then the endif and any other commands.

My game will make sure Final Fantasy will never be forgotten.
Remember me because my game will be in the shops in a year or 2.
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 26th Sep 2003 23:56
Wat would the code be for:
say the last button pressed was left so how would i say that display a certain image depeding on wat the last button was tht was pressed?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Sep 2003 23:59
To answer the original question, I think the code you want is



BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 27th Sep 2003 00:07
sorry I cant get the snippet up on my comp
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 27th Sep 2003 00:17
? (no snippets)
Andrew
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location: United Kindom (what makes it important?)
Posted: 28th Sep 2003 00:32
LOL i told you LOL

Follow my code and learn look at some tutorial's

My game will make sure Final Fantasy will never be forgotten.
Remember me because my game will be in the shops in a year or 2.
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 28th Sep 2003 00:39
do
if upkey() = 1 then print "key pressed"
if upkey() = 0 then print "key not pressed"
sync
loop

there is how you check for a key press or no key press.

CTP
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th Sep 2003 02:24
The snippet was

IF SCANCODE() = 0
REM DO WHATEVER
ENDIF

You should be able to see snippets - click on the text that says


BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 28th Sep 2003 03:43
I think snippet only works on IE
What browser you got ads?
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 28th Sep 2003 04:53
Yes, if you are checking if NOTHING is pressed, then say

If Scancode()<1 then ....

RPGamer

Current Project: Eternal Destiny
We need a texture artist!
If your interested email me - Johnrocs@aol.com
Ads
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 29th Sep 2003 18:44
I use Netscape.
Anyway thanks for helping me people I appreciate it.
Really I want:
if left key was pressed then show sprite 1
if right key was pressed then show sprite 2 (until next button is pressed)
Anyone help.
Soz im a newb lol
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 30th Sep 2003 01:53
until next button is pressed?
any button or just left key?

Login to post a reply

Server time is: 2024-09-21 01:16:10
Your offset time is: 2024-09-21 01:16:10