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.

Code Snippets / possess objects

Author
Message
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 11th Feb 2005 05:36
Hello heres a fun little code i made (well at least i think its fun) you might use it for controlling multiple objects its probably pointless but i'm going to share it anyways.. i'm still a newb after all so plz dont bash on me... the controls are a s d and f you have to hold 1 of them down and press left right up and down to move an object tell me what you think

peace

David
sadsack
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 11th Feb 2005 08:34
NICE
I like that very good job
renny
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 11th Feb 2005 09:11
Thx!! i made that in like 5 minutes

David
dj blackdragon3710
20
Years of Service
User Offline
Joined: 5th Nov 2004
Location: In LaLa land
Posted: 12th Feb 2005 00:44
Might be of some use in my game.

It has been said that the body is a slave to the mind. Only the mind knows no freedom.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 12th Feb 2005 00:45
Nice work! I like the concept . Useful!

Payback... Try this:

Replace,


with



You'll save about half the lines of code.

"Droids don't rip your arms off when they lose." -H. Solo

REALITY II
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 12th Feb 2005 02:49
Hey thats cool!!! i was thinkin about makin a game where you are a faded object (like a ghost) and you can move around and you can get inside other objects and control them around and you can leave the object and possess other ones at will and ill make some kind of a point to it. thx for encouraging me everybody!!
peace

David
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Feb 2005 06:46
If I press ASDF all at the same time, it'll move all objects. Which technically I wouldn't expect it to do that, since keystate should only see 1 key at a time. How odd.

"eureka" - Archimedes
vid1987
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Oklahoma
Posted: 12th Feb 2005 07:49
Yes odd indeed.

David
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 12th Feb 2005 09:05
Quote: "keystate should only see 1 key at a time"


No, you're thinking of inkey$. Keystate is always used when multiple key presses are needed.


Neofish
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: A swimming pool of coke
Posted: 20th Feb 2005 23:31
Quote: "Keystate is always used when multiple key presses are needed."

That doesn't work with me while on the topic how can you tell if two keys are being pressed? VK_SPACE and VK_UP both are constants but surely it can only be one of the two

David C, you could make it using a for loop to run all the ifs, so you crush ~15 lines into something like 2

:: AphoticVM oGL Plugin : 0% Complete ::

Login to post a reply

Server time is: 2024-11-23 13:51:37
Your offset time is: 2024-11-23 13:51:37