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.

3 Dimensional Chat / Crosshairs

Author
Message
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 18th Apr 2005 02:12
how do I attach croos hairs to the mouse, so when you move it the crosshairs follow like in battlefield 1942?

Cheers,
Capt. America
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 18th Apr 2005 04:28
create a sprite then set it to the mouse coords each loop

Used to be Phoenix_insane registered in september 2003 despite what the date says to the left <--
PC - amd athlon 2.0ghz, 512mb, GeForce FX 5200 128mb, 200gb, xp pro sp2
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 18th Apr 2005 04:39
How do I set it to the mouse co-ordinates.
Whats th command?

Cheers,
Capt. America
super skull
20
Years of Service
User Offline
Joined: 16th Jun 2004
Location: usa
Posted: 18th Apr 2005 07:43
read the help files!
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 18th Apr 2005 08:05
ok I'll try that.

Cheers,
Capt. America
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 22nd Apr 2005 10:38
I couldn't find anything in the help files?
Can somebody just give me the command, if there is one anyways.

Cheers,
Capt. America
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 22nd Apr 2005 13:15
Position it at mousex() and mousey()

Not that hard

My less-pimp name was Mattman.
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 25th Apr 2005 06:39
Oh!! Gosh that was so easy. I feel stupid now!!
Thanks Edgar!
Oh well atleast you solved my problem.

(Gosh I really feel stupid!!)

Cheers,
Capt. America
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 25th Apr 2005 06:42 Edited at: 25th Apr 2005 07:56
Edgar,

Would I just say:

load image "cursor.bmp",1
sync on : sync rate 0 : hide mouse
do
postion 1,mousex(),mousey()
sync
loop

or is there even a 'position' command?

Cheers,
Capt. America
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 25th Apr 2005 07:53
Nevermind already answered my own question!
Thanks for jogging my memory though!

Cheers,
Capt. America
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 25th Apr 2005 07:55 Edited at: 25th Apr 2005 07:56
I put:

load image "cursor.bmp",1
sync on : sync rate 0 : hide mouse

do
cls
sprite 1,mousex(),mousey(),1
sync
loop

Now I can work on my game thanks again!!!

Cheers,
Capt. America
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 25th Apr 2005 08:33
Dont use CLS, its bad. Sprites should automatically refresh their background. If not, use SET SPRITE and look at the backsave state. Set it to whatever is 'I'll refresh my background on my own' cant remember if its 0 or 1, as you already have the sync command refreshing everything for you.

And please please please please PLEASE use the edit button for all thats good and holy


Click here to join our forums and get updates on game progress sooner!
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 26th Apr 2005 13:41 Edited at: 26th Apr 2005 13:45
ok I'll use the edit button,
and I'll take out the cls,
and also I added, so when you click th left mouse button a little explosion appears in the middle of your cross hairs like you fired the guns. I also added sound. My next task will probably be to have a screen with aliens or terrorists and when you shoot at them a blood splatter appears where you shoot. I don't know exactly how to do this but I think I might just use the:

if mousex()>10 and mousex()<10 and mousey()>10 and mousey()<10
paste image 2(dead alienterrorist),10,10
else
sprite 3(fire explosion thing),mousex(),mousey(),3
endif

EDIT: (I don't know if I got the > and < facing the right way, but I'll figure that out.)


I'm gonna put that in if it's right.

EDIT: P.S. I used the edit thing in this post!!!
Thanks again!

Cheers,
Capt. America
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 27th Apr 2005 00:14
> and < are basic math opperators O_O What math experience do you have from school and stuff?

The way you have it set up, it will fail miserably. That literraly translates to:

If mouse x cordinate is greater then 10, and mouse x cordinate is less then 10 and mouse y cordinate is greater then 10, and mouse y cordinate is less then 10, so your checking for a non-existant area.

If your doing a 3D game, youll want to look into finding where your mouse cordinate's appear in 3D Space. Nuclear Glory Collision DLL is -great- for this, it even has examples in the demo on how to do this. It makes it very easy to position bullet holes and find bullet collisions anywhere in 3D space or even on another model. I highly suggest it for how cheap it is.

Look around in the code base, I dont have a compiler/or any time to code here in study hall, but that should get you started.


Click here to join our forums and get updates on game progress sooner!
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 27th Apr 2005 02:07 Edited at: 27th Apr 2005 02:07
in other words swap the < and >s around. (edit: if it's a 2d thing, if it's 3d go with rpgamer)

http://www.larinar.tk
AMD athlon 64 3000+, 512mb ddr400, abit kv8, 160gb hdd, gigabit lan, ati radeon 9800se 128mb.
Captain America
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Here
Posted: 29th Apr 2005 00:28
Yea that's what I meant when I said that I didn't think I got them right!
My code eould be:


Now I got it right, I mean I've done that before to make a menu for a game, and I just never can remember which way they go.

Also, RPGamer can I get Nuclear Glory Collision DLL for free or how much is it?

Cheers,
Capt. America
Philip 1337
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 29th Apr 2005 01:48

Login to post a reply

Server time is: 2024-11-27 21:25:48
Your offset time is: 2024-11-27 21:25:48