Deprecated: Function set_magic_quotes_runtime() is deprecated in /usr/www/users/phun/forum/include/common.php on line 58

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/phun/forum/include/common.php:58) in /usr/www/users/phun/forum/header.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/phun/forum/include/common.php:58) in /usr/www/users/phun/forum/header.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/phun/forum/include/common.php:58) in /usr/www/users/phun/forum/header.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/phun/forum/include/common.php:58) in /usr/www/users/phun/forum/header.php on line 34
Phun - 2D physics sandbox - forum / shooter with mouse aim?

Phun - 2D physics sandbox - forum

Official Forum

You are not logged in.

#1 2009-03-23 17:55:18

Ian151
Respected Member
Registered: 2008-06-16
Posts: 108

shooter with mouse aim?

Ive started seeing some scenes that use mouse control (the scripting- it seems to be really helpful if you know how to use it) and I was wondering if there was a way to aim something, like a gun, where the mouse is pointing.  Is this possible?  If so, then how would I do something like this? It would also be helpful to know how to spawn objects in the simulation, however Im sure something like that would be somewhere around here to find out.

Any ideas how this would work?  Im not very experienced with thyme.


My Favorite Scene I made:  Ragdoll Masters Phun Version
Ian151's scenes
Ian Games Is a collection of Games on Phun I've created.  I recently created the idea to include them in "Ian Games" however, The name has existed from my imagination since I was younger, even before Phun.

Offline

 

#2 2009-03-23 19:57:01

Physicsguy
Newtonator
From: A Life Sustainable Atmosphere
Registered: 2008-10-24
Posts: 914
Website

Re: shooter with mouse aim?

Me neither.  Good idea, though.  Your best bet is an answer from grady.


http://i43.tinypic.com/zlp8b9.jpg << Magic Sig!    Click below to go to PGCode, my sub-site dedicated to all code!
http://tinyurl.com/ms5k47http://i26.tinypic.com/s6nfv4.jpg
^Click to level up my license!^

Offline

 

#3 2009-03-24 01:30:15

Frank
Post Manic
From: the dark side of the moon
Registered: 2008-11-18
Posts: 784
Website

Re: shooter with mouse aim?

Code:

App.GUI.mousePos

Already on it.


Noob-friendly, unless you're being an idiot or a jerk.
You have a question?  I probably have an answer.  PM me!
You need some cool scripting for your scene?  I can help with that too.
Bocking is the most awesome sport ever.  Check it out at www.poweriserpages.com!

Offline

 

#4 2009-03-24 02:12:50

gradfitz
Post Manic
From: Australia
Registered: 2008-10-05
Posts: 823

Re: shooter with mouse aim?

Code:

App.mousePos

Is the correct code smile
I don't remember if you can, but I think you can bind a key to do something on mouse click (meaning you could create a button to create liquid or something smile), but I don't remember (I think you can bind scrolling, so....)


http://miniprofile.xfire.com/bg/sf/type/2/gradyfitz.png
Thyme: Tutorial - Beta 5 Command List
I made a typo in my username, it's meant to be gradyfitz.

Offline

 

#5 2009-03-24 02:37:19

Iggyhopper
Respected Member
From: CA
Registered: 2009-03-22
Posts: 151

Re: shooter with mouse aim?

gradfitz wrote:

Code:

App.mousePos

Is the correct code smile
I don't remember if you can, but I think you can bind a key to do something on mouse click (meaning you could create a button to create liquid or something smile), but I don't remember (I think you can bind scrolling, so....)

Well, whatever it is, I couldn't find the key (well, it is a mouse click, not a key anyway).


Tutorials: Trampoline

http://internets.tj09.ath.cx/image/1735.png

Offline

 

#6 2009-03-24 03:36:08

RBS
Post Addict
From: State of Denial
Registered: 2008-08-27
Posts: 733

Re: shooter with mouse aim?

I've been thinking about how to make a shape point at the mouse. I bet I could do it if it's possible to assign a pointer value to the angle of a shape. Like how you can assign stuff in a shapes script menu (except angle and position aren't in the menu). I bet it's doable but I'm not sure how.


It's hard to remember to live before you die.

Offline

 

#7 2009-03-24 03:47:13

Iggyhopper
Respected Member
From: CA
Registered: 2009-03-22
Posts: 151

Re: shooter with mouse aim?

You know, you would have to do some math there, like finding the angle between two points.


Tutorials: Trampoline

http://internets.tj09.ath.cx/image/1735.png

Offline

 

#8 2009-03-24 13:20:48

zand3r
Member
Registered: 2009-03-22
Posts: 13

Re: shooter with mouse aim?

how do you use scripts in phun anyway?  i was kind of wondering...i used to do a lot of game maker stuff and wrote some simple programs

Offline

 

#9 2009-03-24 16:20:01

ioncann0ns
Posting Lord
Registered: 2008-03-09
Posts: 1082

Re: shooter with mouse aim?

Check out the tutorial on it by grady.


http://img194.imageshack.us/img194/2937/logosplash.png

Offline

 

#10 2009-03-26 02:25:33

RBS
Post Addict
From: State of Denial
Registered: 2008-08-27
Posts: 733

Re: shooter with mouse aim?

Hows this?

http://www.phunland.com/phunbox/upload/image/th/18071_Shooter.png
Author: RBS
Title: Shooter version 3
File Size: 302.17 kB
http://www.phunland.com/phunbox/theme/img/download_bar_red_part.pnghttp://www.phunland.com/phunbox/theme/img/download_bar_blue_part.png

Last edited by RBS (2009-03-31 03:53:20)


It's hard to remember to live before you die.

Offline

 

#11 2009-03-26 07:50:10

Blitzgrutel
Seasoned Member
Registered: 2009-03-13
Posts: 91

Re: shooter with mouse aim?

ioncann0ns can you just put a link for the tutorial script?

Offline

 

#12 2009-03-26 09:10:44

Blitzgrutel
Seasoned Member
Registered: 2009-03-13
Posts: 91

Re: shooter with mouse aim?

I've check the entire tutorial section and there's no tutorial being created by Grady.

Last edited by Blitzgrutel (2009-03-26 09:10:58)

Offline

 

#13 2009-03-26 10:25:02

RicH
zupaman
From: Philippines!!!!!!
Registered: 2008-03-19
Posts: 1979
Website

Re: shooter with mouse aim?

http://www.phunland.com/forum/viewtopic.php?id=6392
http://www.phunland.com/forum/viewtopic … 30&p=1

It was moved to the Phun scripting section, since it is about thyme.


http://i350.photobucket.com/albums/q427/RicH0864/LOLmysteryfail.png

Offline

 

#14 2009-04-17 07:09:41

Mystery
#1 suck-up of 2009
From: Southern Australia
Registered: 2009-02-13
Posts: 947

Re: shooter with mouse aim?

RicH wrote:

http://www.phunland.com/forum/viewtopic.php?id=6392
http://www.phunland.com/forum/viewtopic … 30&p=1

It was moved to the Phun scripting section, since it is about thyme.

i still couldn't find it sad


http://img5.imageshack.us/img5/5807/phunmysterysig.jpg
If this link misleads you its your own fault   Free Cookies!

Offline

 

#15 2009-04-19 14:51:02

Rhett97
Post Addict
From: At Tako bell eating takoz
Registered: 2008-11-26
Posts: 711
Website

Re: shooter with mouse aim?

do u mean like an fps?? i have an idea if it is. i probably couldnt make this but. Have like 4 really big pistons that somehow move in sync with ur mouse. (kinda like those Gps deals you see on mythbusters and prototypes this.) and those pistons push the 'gun in sync with ur mouse


http://i484.photobucket.com/albums/rr204/Bronie12345/blueside640x480.jpg

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

Phun and Phunland.com is copyright of Algoryx