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 / why can't I move?

Author
Message
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 23rd Dec 2005 22:18
I am making a level for a game but strangely I can't move forward or backward. Please help.



Mysteries Surround You
Justin W
20
Years of Service
User Offline
Joined: 28th Apr 2004
Location: Vancouver, Canada
Posted: 23rd Dec 2005 23:40
ok well the problem is when you are checking for collision with your player object like this:

if object collision(121,0)>0 then position object 121,X#,30,Z#

at the top of your loop you are repositioning the gun at the players coordinates which means that the gun will always be colliding with the player which means that your player will never be able to move.

So simply remove the gun or use a beter collision detection system. Hope that helps if not just post again!
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 24th Dec 2005 01:22 Edited at: 24th Dec 2005 01:26
It still does not work. This is my updated code.


Mysteries Surround You
Justin W
20
Years of Service
User Offline
Joined: 28th Apr 2004
Location: Vancouver, Canada
Posted: 24th Dec 2005 04:27
you need to put a for next loop around your collision code I see you already have the X in there for the collision object.
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 24th Dec 2005 19:02
I don't understand completely what you mean

Mysteries Surround You
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 24th Dec 2005 20:20 Edited at: 24th Dec 2005 20:20
take this code



and change it to something like this





Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 24th Dec 2005 20:37
if i do that then it tells me that object does not exist at line 52(where the collision code is).

Mysteries Surround You
Justin W
20
Years of Service
User Offline
Joined: 28th Apr 2004
Location: Vancouver, Canada
Posted: 24th Dec 2005 22:08
Try:

for x = 1 to 120
if object collision(121,0)=x then position object 121,Xpos#,30,Zpos#
next x
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 25th Dec 2005 00:18
I can move with that but it does not stop me when I collide.

Mysteries Surround You
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 25th Dec 2005 02:48
comment your code and space it out a little so its easier to read

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself 
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Dec 2005 14:19
yknow what the problem is?

This is the part that makes the trees. And you're making 60 in total. inc x is not needed.
The objects that exist would be 1, 3, 5, 7, 9, etc...

remove the inc x and use antidotes code or use this code if don't want to delete the inc x:
Hippie Dude
19
Years of Service
User Offline
Joined: 6th Feb 2005
Location: California, United States
Posted: 25th Dec 2005 19:05
Thanks alot!

Mysteries Surround You

Login to post a reply

Server time is: 2024-09-24 11:25:43
Your offset time is: 2024-09-24 11:25:43