Games Achievements My Kong Sign In

Comments for Stencyl Tutorial 4: Mouse-Based Shooting

« Back to Stencyl Tutorial 4: Mouse-Based Shooting

DemonOfMist

Apr. 20, 2015

Under rating threshold (show) Re-did this tutorial. I had to refresh some of the trigonometry by referring to some websites, but I got it. Thanks!

+ - !

(0)

Developer response from 0_Tuo_0

I'm glad you got it down :)

DemonOfMist

Apr. 13, 2015

Under rating threshold (show) I had to tweak the collision part (the colliding shape detector) a bit to make it work due to updates. It works, but hope it will not cause problems when I finish tutorial 4.

+ - !

(0)

Developer response from 0_Tuo_0

You have me curious: what tweaks did you need to do?

DemonOfMist

Apr. 13, 2015

Under rating threshold (show) Found it! You can check width in Stencyl under collision tab of the actor.

+ - !

(0)

Developer response from 0_Tuo_0

If you are constantly changing the size, a draw text and/or print command can work in real time too ;)

DemonOfMist

Apr. 13, 2015

Under rating threshold (show) Do we always have to open paint to find out what is the width of our actor? Is there a way to check in Stencyl?

+ - !

(0)

Developer response from 0_Tuo_0

There are many ways, including the collision tab (I often create a new box collision and then cancel as it will show the actual size if I've adjusted the collision box currently on it).

DemonOfMist

Apr. 13, 2015

Under rating threshold (show) Trigonometry... I learned that stuff so long ago wondering why I ever did, but now it comes down to this....

+ - !

(0)

Developer response from 0_Tuo_0

Aye, I use my programming as an example for students who don't see the value in trig ;).

123kenny10

Dec. 04, 2013

Under rating threshold (show) you know the bullet look just like the one i made LOL

+ - !

(0)

Developer response from Abigayl

It's a circle. There really is not a lot of varieties for circles... :P

Toope00

Dec. 04, 2013

Under rating threshold (show) What if the bullet comes from the back of the actor and hits the actor itself?

+ - !

(0)

Developer response from Abigayl

If you have the collision groups set so that the bullet's group doesn't collide with the player's group, then it shouldn't be an issue.

sirmoo2

Oct. 23, 2013

Under rating threshold (show) my actor does not seem to point towards my mouse. i have tried everything. PLEASE HELP!!!

+ - !

(0)

Developer response from Abigayl

If your scene is bigger than your screen, you'll have to add the x/y of the camera to the x/y of the mouse for it work properly. If you post a screenshot of the coding (or upload the game to StencylForge and make it public), I can try to look at it to see what's wrong.

Abigayl

Oct. 17, 2013

Under rating threshold (show) SirMoo: In the Actor -> Position palette, there is a "point self to X degrees". That is what I am referring to.

+ - !

(0)

sirmoo2

Oct. 16, 2013

Under rating threshold (show) I do not see the "face direction" code block you had mentioned earlier. PLEASE HELP!!!!

+ - !

(0)

Abigayl

Oct. 16, 2013

Under rating threshold (show) Hello Sirmoo, For whatever reason, I can't seem to create a response, but yes you can. In the Actor palette, there is a "face direction" code and you can use the same coding for the shooting for that direction (you will likely have to add or subtract 90 though to make it work).

+ - !

(0)

sirmoo2

Oct. 16, 2013

Under rating threshold (show) Hey there! Is there any way i can have my player face the mouse constantly, like turn and face the mouse no mater where it is on the screen? I keep trying but still have no luck :(

+ - !

(0)

roflmoqkz2

Oct. 10, 2013

Under rating threshold (show) For some reason my game crashes when the enemy dies. I did exactley what you did and it doesnt work.

+ - !

(0)

Developer response from Abigayl

Can you describe the crash? Is there an error that pops up? If you want, upload the file to StencylForge (don't forget to make it public) and let me know the name, and I'll take a look at it for you. There's not much I can do without seeing the file itself.

BalsG

Aug. 23, 2013

Under rating threshold (show) Yeah, i can shoot(and move) in only half of image, instead if all image, sorry for my english.

+ - !

(0)

Developer response from Abigayl

Perhaps upload your game to StencylForge, make it public, and tell me the name of it. I'm still not understanding the issue, so seeing it directly might be better.

BalsG

Aug. 23, 2013

Under rating threshold (show) Question is: Why? (see in previous mesage the problem) and how to make to be the full image?

+ - !

(0)

Developer response from Abigayl

I don't understand. Why do you mean "can't shoot in all image"? That was the question.

BalsG

Aug. 23, 2013

Under rating threshold (show) another question: if i shoot i cant shoot in all image (just in left and up the right and down is only a half of distance

+ - !

(0)

Developer response from Abigayl

Question: What is the question?

BalsG

Aug. 23, 2013

Under rating threshold (show) hey! i watch all the tut, did all right but when the bullet colide with the enemy just push them away, don't kill em.

+ - !

(0)

Developer response from Abigayl

Make sure you have the kill codes in the collisions and that the behaviors are each attached to the actors.

young1000

Aug. 04, 2013

Under rating threshold (show) can i make my own?

+ - !

(0)

Developer response from Abigayl

That's the entire point of this series! :D (Do be sure to start at part one though; the site for Stencyl is www.stencyl.com)

goldpig3718

Aug. 03, 2013

Under rating threshold (show) this game is cool

+ - !

(0)

Developer response from Abigayl

It's even cooler when you make it yourself! :)

Darksaber530

Apr. 25, 2013

Under rating threshold (show) Thanks! Now I can complete my game. I modified the healthbar script so that when the enemy's health is low, the healthbar changes color. Thanks again for the help!

+ - !

(-1)

Developer response from Abigayl

You're welcome. I'm happy to help :).

Darksaber530

Apr. 24, 2013

Under rating threshold (show) I followed this tutorial exactly and I have a 75 tile long screen (each tile is 32x32 and the character is 30x90) and when my character passes oh say about the 1/2 way mark across the level, the bullets only shoot in the left direction! The ip and down is fine, to a point, where they wont pass about 45 degrees in either direction. Once I pass over the halfway mark again, the bullets act correctly. Help!

+ - !

(0)

Developer response from Abigayl

When making a scene bigger than one screen, you need to add to the player: "always move camera to self" and add the x/y of the camera to the x/y of the mouse in the atan code.

klimtkiller

Mar. 10, 2013

Under rating threshold (show) high score: 1711 :)

+ - !

(-1)

Developer response from Abigayl

Congrats :)

Gallade

Feb. 11, 2013

Under rating threshold (show) I went from understanding jack-butt of Flash Game making to...well, understanding the bare basisc of Flash Game making. Thanks!

+ - !

(-1)

Developer response from Abigayl

lol, you're welcome... I think :P.

BaoetTam

Jan. 12, 2013

Under rating threshold (show) 5/5 because this tutorial is awesome and because 100% of revenue goes to charity.

+ - !

(2)

Developer response from Abigayl

Thanks :)

letsgome

Dec. 27, 2012

Under rating threshold (show) never mind, figured it out

+ - !

(0)

Developer response from Abigayl

Glad you got it working :)

letsgome

Dec. 27, 2012

Under rating threshold (show) how do u submit the scores?

+ - !

(0)

PhaserRave

Dec. 26, 2012

Under rating threshold (show) Yes. It was really odd. It just didn't work when the same code was in a behavior, and only worked when it was in the actor's event tab. :s

+ - !

(0)

Developer response from Abigayl

If you want to, upload it to StencylForge, and I'll take a look at it.

PhaserRave

Dec. 16, 2012

Under rating threshold (show) Yes, I had.

+ - !

(0)

Developer response from Abigayl

Are you sure that you have the bullet as a sensor collision and that its collision group doesn't hit the player's group?

PhaserRave

Dec. 15, 2012

Under rating threshold (show) Might be a double post, but it doesn't seem to have posted my first comment. Somehow when I include the code as a behavior, my actor won't shoot anything, but works when I include the code in the actor's event thing.

+ - !

(0)

Developer response from Abigayl

Did you remember to attach the behavior to the actor? That is the issue with behaviors: it's easy to forget to "attach to actor" (the big green button in the upper-right).

strit5

Oct. 31, 2012

Under rating threshold (show) Thanks a lot! :) I really like that you respond on all comments :D

+ - !

(2)

Developer response from Abigayl

You're welcome ;)

strit5

Oct. 30, 2012

Under rating threshold (show) What to do when your own bullets hits your own actor? Cause I cant get the bullets in front of my actor so he can shoot the enemies. My actor hits himself and then the bullet is gone

+ - !

(1)

Developer response from Abigayl

Check your collision groups to make sure the bullet's group is not set to hit the player's group. If needed, make a new group to do it.

strit5

Oct. 30, 2012

Under rating threshold (show) Oh man!! I just watched whole this tutorial, and then I find out that I also need to watch 2 and 3.. -.-

+ - !

(1)

Developer response from Abigayl

What about Tutorial 1? :P

chinotacua

Aug. 31, 2012

Under rating threshold (show) Thanks!, you're the boss :p

+ - !

(1)

Developer response from Abigayl

Well... I own my own tutoring business, in which I am the only employee... so I am both boss and employee... :P. Anyways, glad you liked it! :D

Glock243

Aug. 13, 2012

Under rating threshold (show) How could I make the bullet shoot in the direction the player is facing?

+ - !

(0)

Developer response from Abigayl

In the Actor -> Position palette, you can find the "direction self is facing" code. Then, you can use that as the angle for the bullets (please note, you may have to add/subtract 90 from it to make it work correctly, depending on how you setup your actors).

Sagalink

Aug. 10, 2012

Under rating threshold (show) I'll probably never really make a video game but knowing alot about how they are made really shows me how much people work on them, which helps me respect even weaker games. I CANNOT believe it is so complicated, but if you practice, you can even make a totorial on making a game, huh? :)

+ - !

(0)

Developer response from Abigayl

Aye, for the most part, you can estimate at least one hour of programming per MINUTE of gameplay (varies a lot depending on if you are making a mini-game or a full-fledged game).

doodle_man

Jul. 26, 2012

Under rating threshold (show) OMG I really need your help to make my game.What ever I do it sometimes work like I cant get score I cant find out how to make the enemy's move left to right by them self because I am trying to make a maze game so I cant have the enemy's spawning all over the place.Please help me I would love you if you did help me. <3

+ - !

(1)

Developer response from Abigayl

Best way to reach me in real time is via my livestream: livestream.com/poweredbyflowers

Abigayl

Jul. 24, 2012

Under rating threshold (show) Thank you all for your ratings! This is now a "legendary" tutorial (over 4.0 with 500+ votes). :)

+ - !

(6)

Mat2PL

Jul. 23, 2012

Under rating threshold (show) I have to admit that this tutorial is best if you need help in starting "programming" in stencyl, very usefull and simple. tuvm.

+ - !

(1)

Developer response from Abigayl

You're welcome :)

Travis0902

Apr. 14, 2012

Under rating threshold (show) Make a tutorial on how to rate 5 stars. Because some people dont know how to do that at your game. But I do. :) 5/5

+ - !

(7)

Developer response from Abigayl

Thanks for your support and for making my day :D

dreeseaw

Apr. 08, 2012

Under rating threshold (show) I followed your exact shooting coding but it will always fire just 1 bullet

+ - !

(-1)

Developer response from Abigayl

Are you sure you used a "do every" instead of "do after" code? If you want, upload the game to Forge and send me a PM with its name and I'll take a look at it to see what's wrong.

PaulisterGaming

Apr. 08, 2012

Under rating threshold (show) HELP! For some reason I can't fire the bullets!!

+ - !

(0)

Developer response from Abigayl

Are you sure you attached the behaviors? If you want, upload the game to Forge and send me a PM with its name and I'll take a look at it to see what's wrong.

nzjackass

Apr. 06, 2012

Under rating threshold (show) kk thx i like how you respond to every single comment and very quickly aswell 5/5 to all of your tutorials

+ - !

(2)

Developer response from Abigayl

Thanks for the 5's. I do my best to answer comments (although the best methods are via my livestream or via PM).

nzjackass

Apr. 06, 2012

Under rating threshold (show) when u shoot the enemys on your game how did u make them rotate when hit? is it just default or what

+ - !

(1)

Developer response from Abigayl

It's generally the default. To turn it on/off, go into the the physics tab of the actor and turn on/off rotation freely.

death1hand

Apr. 03, 2012

Under rating threshold (show) please can you do a graphics tutorial, my code is ok but im rubbish at graphics

+ - !

(2)

Developer response from Abigayl

My graphics are generally pretty bad too, unless I spend a LOT of time on them. That come down more to networking. There are forums on Stencyl.com to find artists/musicians to work with or DeviantArt is another good choice.

qwertyuiopazs

Mar. 29, 2012

Under rating threshold (show) Oh, I accidently did create bullet at (x:x of self, y: x of self.) by the way the bullets weren't going where i clicked, they were going at what seemed to me as random places, and I just happened to click on two in a row and assumed wrong.

+ - !

(0)

Developer response from Abigayl

So it works now? If so, good (couldn't really tell by your post)

qwertyuiopazs

Mar. 28, 2012

Under rating threshold (show) Also, I can't find out why, but my bullets are spawning from where my mouse clicked, not the guy.

+ - !

(-1)

Developer response from Abigayl

If you want, take a screenshot of the code and send me the link (or just upload the game to StencylForge and send me the title). You likely have some correct coding in the wrong spot, such as putting the bullet creation in a scene behavior instead of the player behavior.

qwertyuiopazs

Mar. 28, 2012

Under rating threshold (show) I would love it if at the end you showed a picture of all the coding you changed so I could fix my mistakes without having to go through the tutorial at the end.

+ - !

(-1)

Developer response from Abigayl

There are so many areas that can change that it's hard to do a screenshot of all of the updates... would require a couple of slides just to show all of the code. I tried to do something similar by having recaps, but I know it's not quite the same thing.

monsterjamp

Mar. 25, 2012

Under rating threshold (show) I followed your tutorial again and saw i used "Group for this actor's colliding shape" instead of "group for colliding shape". Now the bullets work properly. But may i ask you what is the difference between those 2. P.S. Thanks for your help but i may keep asking questions later on but right now I'm doing good.

+ - !

(1)

Developer response from Abigayl

The "group for this actor's colliding shape" is a very rarely used code, but it is indispensable to some programmers. It is designed for those who use multiple collision shapes on a single actor, such as animation that includes a sword. Those animations can have multiple different groups attached, and that code allows programmers to figure out which one was hit. For the majority who use one collision shape per actor, it's not needed.

monsterjamp

Mar. 24, 2012

Under rating threshold (show) Yes the collision groups are okay. The bullet hits what i want it to hit but it does not seem to follow the "Kill Self" command.

+ - !

(1)

Developer response from Abigayl

Can you screenshot the coding and send me the link? Or, better, could you upload it to the Forge and tell me the name, and I'll take a look at it?

monsterjamp

Mar. 24, 2012

Under rating threshold (show) I actually figured out what i was doing wrong after i posted that comment. I have one problem (sadly) the bullets wont disappear when they hit an actor and the actor does not die by the bullet. I don't know what i am doing wrong. please Help Again.

+ - !

(0)

Developer response from Abigayl

Are the two colliding? Check your Game Center -> Collision Groups and make sure the button between the enemies and the bullets is green, not blue.

  • add a comment
Developers Players Support YouTube TikTok X (Twitter) LinkedIn
Join the conversation Join Discord
Terms of Service Privacy Policy Code of Conduct
© 2025 Kongregate