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 / Using mouse to control a sword.

Author
Message
The Amazing O
20
Years of Service
User Offline
Joined: 21st Aug 2004
Location: South Lopham, Diss
Posted: 3rd Oct 2005 20:56
I just had what I think, is a brainwave for a cool way to use a sword in a video game -
Basically you move the mouse up, down, left and right, to move the on screen sword up, down, left and right.
Then when you want to strike hold down the mouse button and drag your mouse around to try and strike your opponent!

I was wondering, would this be possible to do on DarkBASIC (pro)?
I havent got much of a clue as to where to start, I guess it would be, make a cube (for the sword model), and position it at mousex() and mousey() then thats about as far as I have thought this through (I came up with the idea about 2 minutes ago )

Any ideas on how to make something like this?
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Oct 2005 01:35 Edited at: 4th Oct 2005 01:36
The mouse isn't the ideal device for this sort of object control, so I didn't think there would be many who would give this one a try.

But, being a sucker for a challenge, I've given it my best shot...



You'll need to download the attached sword I just made though.

[Edit] Damn - forgot to mention it was done in DBC, but I can't see any reason why it shouldn't work fine in DBP.

TDK_Man

Attachments

Login to view attachments
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 4th Oct 2005 11:27 Edited at: 4th Oct 2005 11:39
I starting making something like this in DBP ages back...its in the Game Design Theory Board....I'll just go find it !

{EDIT}
Hey, there i'm back. Youd can find the thread here:
http://forum.thegamecreators.com/?m=forum_view&t=41120&b=19
The code i wrote is on the first page...its very basic, but gives some basic control. As I said in the other thread, feel free to modify/mutilate/butcher/etc the code however you feel, but if you create something very cool with it email me to let me know !

Hope it helps

{EDIT}
TDK's may be better...I cant tell as I dont have DBP installed at the mo. So if it is better, sorry for the usless post !

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th Oct 2005 12:47
Baggers:

My code is for DBC.

TDK_Man

The Amazing O
20
Years of Service
User Offline
Joined: 21st Aug 2004
Location: South Lopham, Diss
Posted: 4th Oct 2005 18:24
WOW!, both of those are really awesome!
I think TDK's is probably the best for a sword, but just playing around with Baggers - the cube could be used a a gun turret and when you click the mouse a projectile is launched from the tip of the cube to blow up various aliens...a 3D space invaders perhaps, where the actual gun rotates instead of a cursor moving. (just an idea)

Login to post a reply

Server time is: 2024-11-13 21:11:00
Your offset time is: 2024-11-13 21:11:00