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 / rotatey-forward key pressed-yrotate resets to play animation..

Author
Message
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 3rd Feb 2009 15:10 Edited at: 3rd Feb 2009 16:00
heres the code:

load object "Waitingworks4.x",1
load object "Waitingworks5walk12.x",2
hide object 2
position object 2, 0, 0, 0
xrotate object 2,90
position object 1, 0, 0, 0
xrotate object 1,90
aY# = Object angle Y(1)
REM START LOOP
DO

IF UPKEY() = 0
HIDE OBJECT 2
SHOW OBJECT 1
set object speed 1,5
LOOP object 1,1,231
ENDIF


if upkey() = 1
hide object 1
show object 2
set object speed 2,5
LOOP object 2,1,21
ENDIF

rem IF LEFTKEY() = 1

Rem Control input
rem If Upkey()=1 then Move object 1,2
If Leftkey()=1 then aY# = Wrapvalue(aY#+1)

If Rightkey()=1 then aY# = Wrapvalue(aY#-1)

rem rotate the sphere
Yrotate object 1,aY#


LOOP

Im looking for the player to remain facing the direction he was turned when forward is pressed,which isnt happening the players rotation is reset when forward is pressed ,please could you improve the code to allow the player to remain facing the direction he was turned when forward is pressed,AND turning when walking simulteneously please,using the arrow keys.
Only one of the animations is uploaded,if you would like the other I will change the upload just ask me.
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 4th Feb 2009 02:22
just try using turn object left and turn object right, thats what the help files are for...
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 4th Feb 2009 04:05
Only just spotted this, I answered in you other thread
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 4th Feb 2009 08:19 Edited at: 4th Feb 2009 08:20
thx,got it to rotate and keep facing the same direction,missed a line of code to update object 2:yrotate object 2,ay# was missing.
Can you tell me if I want to stop a objects loop what code would i use,i tried using (loop end object 1)but it crashes.
Many thanks.
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 4th Feb 2009 08:22
well when do you want the loop to end
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 4th Feb 2009 08:53
when upkey is pressed
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 4th Feb 2009 09:25
well just use




thats basically how it would work...
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 4th Feb 2009 09:31
Many thanks but is there a command I can use instead,a stop loop object 1 command.
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 4th Feb 2009 09:36
not that i know of..

sorry.
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 4th Feb 2009 12:49
Got there eventually:


stop object 1
set object frame 1,0

works perfect.

Login to post a reply

Server time is: 2024-09-28 02:23:52
Your offset time is: 2024-09-28 02:23:52