Mouse Button Down Event

Talk about making games.

Mouse Button Down Event

Postby ALK3_Steph » Sun Sep 25, 2005 2:26 pm

Am I totally missing something cause I cant do anything with the mouse down or up events. Like, I made a really simple create actor when you use the right mouse button, but, alas no luck. Same with the left button, and mouse wheel button. But I have made the target follow the mouse on the X axis so I dont know whats going on. Haha. Any help?
"Take your wings outside, you cant fly in here, besides purple skies are betting soaring for you my angel, you're an angel, you little devil. As for me I'll be just fine as I stay inside and watch from the window" -Alkaline Trio (Goodbye Forever)
ALK3_Steph
 
Posts: 27
Joined: Sat Sep 10, 2005 2:40 am
Location: Norfolk, VA
Score: 0 Give a positive score

Postby Novice » Mon Sep 26, 2005 8:37 am

U have to click on the actor that has the event or make a filled region to click iniside of. In my knowlage clicking on an empty screen wont do anything but maybe im wrong.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby ALK3_Steph » Tue Sep 27, 2005 5:09 pm

Ok so I figured out the mouse down event, it does need to be on something clickable, so I made a sensor the size of the screen, and that allowed me to make the shot. But, it would only work if I had the shot set to a parent, which was player in this case. The draw back to that is that if I move my mouse back and forth, it moves the ship along the X axis, but, all the shots stay parented by the ship so they move side to side along with the ship. Blah to it all. Haha
"Take your wings outside, you cant fly in here, besides purple skies are betting soaring for you my angel, you're an angel, you little devil. As for me I'll be just fine as I stay inside and watch from the window" -Alkaline Trio (Goodbye Forever)
ALK3_Steph
 
Posts: 27
Joined: Sat Sep 10, 2005 2:40 am
Location: Norfolk, VA
Score: 0 Give a positive score

Postby Novice » Tue Sep 27, 2005 8:28 pm

It realy simple just do this in script editor:
1.on mouse button down crete actor "shot"
on the shot actor do this:
1.On create actor get the angle betwen the mouse and ship using
Code: Select all
angle = direction(ship.x,ship.y,shot.x,shot.y)

2.set directional velocity to 10
3.off screen destroy actor
If you do this on mouse click the shot should be fired from the ship in the direction of the mouse and be destroyed when out of the screen to save memory. You should realy do the moon defender tutorial it will explain it better.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest