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 / using arrow keys to move object

Author
Message
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 3rd Jan 2005 11:20
Hi,
could somone please give me a small snippet on how to make it so when i hit the up, down , left or right arrow key it moves the object "Night.X"

thanks in addvance

-smart guy
Whisper Wind
21
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 3rd Jan 2005 13:10
DBC or DBPRO? And have you tried the tutorials that come with the program, or searching the forums? Really, you shouldn't have to start a new thread for this! Look around and help yourself, not to sound harsh or anything, but this is really basic stuff that can be found in a lot of places if you look yourself.

Searching for file 'sanity'...
Sorry, no results were found.
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 3rd Jan 2005 13:14
ok and im in pro i need to know hoe to move object not move camera
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 3rd Jan 2005 19:10 Edited at: 3rd Jan 2005 19:11
if rightkey() then position object x,object position x(x)+1,object position y(x),object position z(x)

if upkey() then position object x,object position x(x),object position y(x),object position z(x)+1


etc,etc....


You should probably do some tutorial hunting.

Try:
http://forum.thegamecreators.com/?m=forum_view&t=27053&b=7
http://forum.thegamecreators.com/?m=forum_view&t=21133&b=7
http://forum.thegamecreators.com/?m=forum_view&t=25076&b=7


The word "Gullible" cannot be found in any English Dictionary.
Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 4th Jan 2005 00:39
or use move object which has similar commands for up etc

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 4th Jan 2005 01:20 Edited at: 4th Jan 2005 01:21
`its easiest to do something like this:

`the stuff in parentheses is not in the programming

load object "knight.x",1
do
if upkey()=1
move object 1(which would be specified as "knight.x" earlier),1
endif
if downkey()=1
move object 1,-1
endif
if leftkey()=1
turn object left 1,1
endif
if rightkey()=1
turn object right 1,1
endif
loop
`and a good habit to get into is using variables in place of the
`numbers like:
`move object 1,speed1#
`so u can adjust without having to change anything but one `number
`hope that helped, and theres another way to do it but its more `complicated but necessary if u have the camera at a tilt
`o and when using variables make sure to define before the loop like
`speed1#=1
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 4th Jan 2005 08:38
thanks guys im at _________ right now so ill try them when i get home.

Login to post a reply

Server time is: 2024-09-23 08:22:16
Your offset time is: 2024-09-23 08:22:16