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 / Need a complicated peice of code

Author
Message
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 1st Dec 2002 00:12
Ok here we go:

I need a code that makes an object and when you push and arrow key the object "lunges" to that direction, but is still locked to the point, so the object it sort of on a 10 unit chain, now comes the tricky part, I need it to lunge the same direction, no matter what way the cameras facing (so if you push right and it gose right, then you spin the camera 180 and push right, it will still go right). Anyone up to the challenge? Plese help

ps: sorry if i've been spamming the board with questions
Bitmap
21
Years of Service
User Offline
Joined: 20th Oct 2002
Location: Latvia
Posted: 1st Dec 2002 00:55
Sorry, I don't understand your problem clearly

do you need something like this? :



thy boss
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 1st Dec 2002 01:00
no, I need it so no matter what way the camera is looking at the object, it go'se left relative to the camera, and when it moves, it only moves 10 or so units then stopps, and when you let go it pops back to the center
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 1st Dec 2002 01:42
So code like this?



I don't know if this code will work, it just came straight out of my head. The DBP cd isn't in the drive, so I can't be bothered to test it. You might have to mess about with the sin and cos functions to get it to work. However there should be a cube in the middle of the matrix that you can rotate the camera around using the mouse, left and right arrow keys should move it to the left and right perpendicular to the camera.
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 1st Dec 2002 02:10
Yes thats what I meen darthster, but I need it to move left and right at all angles, if I move it, looking at the corners the box goes forward and backward
TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 1st Dec 2002 03:45
hey TheDarthster,
nice code... especially coming out from your head.

Blazer, i dont know why you need such a math code for something. though, it is a good challenge. i would like to know what you need it for.

Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 1st Dec 2002 03:59
I'm making a diablo type game, but you control your character with arrow keys instead of the mouse. I want to also be able to spin the camera to look at the char from all angles. I made an invisible block, locked onto the char, that the char always points to. So when your press that key the block extends out a bit and the char faces that way. So now you know, plese help
TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 1st Dec 2002 04:14
i am a little confused of what you said. explain more or show an example. and what is a char. i have not played diablo.(programing seems funner...when things work out)

just curious. why does the char has to face the invisible block.

TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 1st Dec 2002 04:16
does char means character? never really heard any one write that.

Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 1st Dec 2002 04:18
yes char means character, sorry I've been playing too much dungeons and Dragons. The char has to face an invistible block because he will look like a moving piller if he dosn't face anything
TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 1st Dec 2002 04:23
forget what i said, just got a little confused for some reason. just why does the char always faces the block. and what does the math code relate to(except with the camera)

Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 1st Dec 2002 04:51
The char faces the block because I put the point object to command in, I don't knwo what you mean relative to
Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 1st Dec 2002 05:36
whats with all the questions anyways, can't you just answer it?
TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 1st Dec 2002 14:43
yeah i answered my questions and i king of skiped your 5th post. that answers my question. sorry if i distrubed you.

The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 2nd Dec 2002 00:33
I've reviewed the code now I've found the CD, and made it work slightly better, although the angles are still completely bodged together. There's probably a better way to write it. Anyway now you move the cube forwards with the up arrow, shift it left and right with the left and right arrows, and turn it using the mouse. This means you can't move the camera round the char, but I'm still not entirely sure how you want the control systenm to work.

Blazer
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: United States
Posted: 2nd Dec 2002 06:03
Yeay! this isn't Exactly what I needed but I think I can toy with it and get it to work, thx all

Login to post a reply

Server time is: 2024-04-24 23:03:54
Your offset time is: 2024-04-24 23:03:54