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 Discussion / platform error

Author
Message
Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 2nd Sep 2006 03:40
Im making a platform type game that uses the point() command to detect for color.

But my character doesnt interact properly with the environment!


See my code:



Ive also attatched the files and an exe if you dont want to compile it yourself.

Cap'n


Cheers,
Capt. America

Attachments

Login to view attachments
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 2nd Sep 2006 04:31
Can you please tell me what is supposed to happen? It's kind of hard to fix something when you don't know what your objective is.

Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 2nd Sep 2006 05:12
oops sorry!

Problem # 1:

When you go underneath the ladders you cant go up them unless you press space (jump), thats because the point where is checks for color is slightly underneath the mans feet.

ex:
O
\|/
|
/\
. <---- here

I Need it to check higher, but in my code you can see I did write another set of commands to check around the mans head, but then it only checked there and he sunk down a bit, I need it to check both areas at the same time.

I have tried doing this:


didnt work!

and this:

didnt work!

and this:


I cant think of any other ways to try right now.

Did that help? I hope so, sorry i forgot to tell what the problem was. Today was a long day @ work, I worked the 5am - 130pm shift!

Not fun!

Ill post other problems later as this is my most urgent one.

Thanks!

Cap'n


Cheers,
Capt. America
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 2nd Sep 2006 15:11
Hmmm... I didn't see any ladder jumping code in there... and I don't know why you checked colors twice. Also, you could jump forever on thin air! All I could figure out to do is change the jumping code to this...



Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 3rd Sep 2006 22:59 Edited at: 4th Sep 2006 07:39
ok well first, the thing is I dont want them to be able to jump on ladders, and also I checked for colors twice because I needed to check for the ground so they wouldnt sink into the floor, and I needed to check a little higher so that you can climb up ladders.

notice how I check many + 20 and many + 50, the many + 50 checks for the floor so that he doesnt sink through, and the many + 20 is sopposed to check for ladders and such, but its not working!

Also, I know that you can jump forever, I was going to fix that later. right now I need him to be able to interact with the evironment!

Sorry if any od this seems rude, I have been told that I am in a very bad mood today. Probably cuz of my 500 am shift at work again!

If worse comes to worse, then I can always just code the levels in by hand, but then that wouldnt allow the user to make levels as easily as I originally planned.

Thanks for trying to help me, and I actually learned something from your post, I had not checked if the gravity was set to 0 or not when trying to jump!

Thanks again!

Cap'n


Cheers,
Capt. America
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 3rd Sep 2006 23:06
I'm glad I could help out a little. Hope you can get this sorted out. Oh, and did you try my code? I thought it had fixed the ladder thing

Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 3rd Sep 2006 23:26
nope it didnt work for me!

Did it work for you?


Cheers,
Capt. America
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 3rd Sep 2006 23:53 Edited at: 4th Sep 2006 00:47
Yup, I climbed up the ladder just fine. I used DBPro though... I'll try it in DBC now.

EDIT: Worked for me! Just replace your current jumping code with the code I provided.

Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 4th Sep 2006 07:42
well it didnt work, maybe im explaining it wrong though.

I want you to be able to walk right up to the ladder and then without jumping at all press the up arrowkey, and walk up the ladder, right now to get on the ladder you have to jump, and I dont want that to happen.

Is it doing this in the code that you gave me?

Cuz whenever I run it with your jumping code It doesnt do what I want it to do.

Thanks!

Cap'n


Cheers,
Capt. America
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 4th Sep 2006 16:22
OH I get it now! I'll try again.

EDIT: Alright, I think I got it. You had 2 checks for ladders. However, the first one (the one that was maybe true) was getting canceled out by the second floor checks, therefore your ladders weren't working properly. I fixed this by putting both ladder checks in the same spot one after another AFTER every other check.

Here's your code, it works fine for me. Hope it works for you as well.



Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 4th Sep 2006 20:29 Edited at: 4th Sep 2006 20:33
Yea! You fixed it!

I just had to put it after the other one?!

well that was easy!

Thanks alot!

also I have some problems with the character being able to go through the walls and such, I want to make a color
rgb(128,0,0) "dark red"
to be inpenetrable so that the user cant cheat to get to the end of the level.

How would I do this?

Thanks again!

Commando


Cheers,
Capt. America
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 4th Sep 2006 22:00
No problem. Just check for the dark red wall on both sides of the player's feet, and if there's a wall then put him back where he was before he met the wall. Try that.

Captain America
20
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 6th Sep 2006 07:03
OK, I cant try that right now, but ill come back later and tell you how it went.

Thanks for all the help!

Cap'n


Cheers,
Capt. America

Login to post a reply

Server time is: 2025-05-26 04:57:04
Your offset time is: 2025-05-26 04:57:04