Games Achievements My Kong Sign In

Comments for Stencyl Tutorial 4: Mouse-Based Shooting

« Back to Stencyl Tutorial 4: Mouse-Based Shooting

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.

monsterjamp

Mar. 23, 2012

Under rating threshold (show) I followed your tutorial but then realized you were shooting from a previously made actor. I want to know how to shoot directly where your mouse is (out of nowhere). Please help.

+ - !

(0)

Developer response from Abigayl

If you want to shoot directly at the mouse, no movement (like in a shooting game), just use the "x of mouse" and "y of mouse" coding alone, without any subtraction. If you want to shoot things directly, then just use "if mouse was released on self" coding in the actor's code itself. Does that make sense?

boxheadwinner

Mar. 17, 2012

Under rating threshold (show) Ah. I had forgotten a part. My bad.

+ - !

(0)

Developer response from Abigayl

Glad ya figured it out :)

boxheadwinner

Mar. 17, 2012

Under rating threshold (show) My bullets won't shoot all around, only in one direction.

+ - !

(0)

Developer response from Abigayl

In your Game Center, check your collision groups and make sure your bullets aren't colliding with your player, which could cause them to bounce off, making them go in only one direction.

screaminpoet

Mar. 05, 2012

Under rating threshold (show) hi abigayl, thanks for the tuts! they were great, easy to follow and entertaining. here is my version, because i use a laptop i opted for a space button gun, with a spray of +-10px. i also made enemys face the direction they are flying which i though made it look so much better. i plan on creating stages and more weapons via powerups. thanks again http://www.kongregate.com/games/screaminpoet/stencyl-tutorial-shooter

+ - !

(0)

Developer response from Abigayl

Not half bad :)

CritterForge11

Mar. 01, 2012

Under rating threshold (show) Guys, just learn how to code in a REAL language, coding a game like this in a real language would take far less more time than it would in Stencyl.

+ - !

(-1)

Developer response from Abigayl

It's not all about speed (and Stencyl is fast) but rather easing into programming. As I have said many times before, if you know how to code in AS3 or another language, you should probably stick to that. Stencyl is a good stepping stone though. You don't go straight to Calculus without first learning about functions ;)

arit3

Feb. 09, 2012

Under rating threshold (show) Dunno if this will be read.. how to make an actor point towards the mouse cursor continuously?

+ - !

(1)

Developer response from Abigayl

I read all comments. To make the actor point towards the mouse cursor, follow the same idea in this tutorial (with the arctan2 coding) but instead of setting the bullet's velocity in that direction, use "point self to x degrees" under Actors -> Position. Note that I think you have to add 90 degrees to the amount you get for the pointing to work properly, and in order to point continuously, it will need to be in the "always" heading... I will caution you that doing a trigonometric function in an "always" heading can lag the game a bit, so I would not advise using the code if it is an intensive CPU game. Hope that helps.

ChazDragoon

Jan. 14, 2012

Under rating threshold (show) ah i see..so, for the sake of example: things like character/enemy attributes (hp, strength, etc.) are better used to local attributes while things like..say.. Day/Night time should be a global?

+ - !

(-1)

Developer response from Abigayl

Correct.

ChazDragoon

Jan. 14, 2012

Under rating threshold (show) alright i got it...seems i forgot the whole local/global attribute thing. :s Thanks Abi.. ^-^ Also, on a side note, i decided to make a key press to start the game from title screen than clicking the start button. Just so i stick it in my head...what is the big difference between a local and global attribute?

+ - !

(1)

Developer response from Abigayl

Aye, key presses are good. The difference is that local attributes are ONLY used by the current behavior (and for each individual actor, aka: multiple enemies with the same behavior can have different local attribute values). Global (game) attributes are used by any behavior, and if the value changes one place, it changes everywhere. Also, local attributes are not saved/loaded whereas game attributes are.

ChazDragoon

Jan. 14, 2012

Under rating threshold (show) Found the problem..but i can't do anything about it. It's the Increment/Decrement...it won't let me change it from "number" to HP. Yet i created the HP attribute as a "number". Also of note, i only have 4 options when making an attribute while your Tutorial shows...more. Either i'm running an old version (which seems odd cause i got it less than a week ago) or..i dunno. *confused!*

+ - !

(1)

Developer response from Abigayl

Chaz, the issue is likely that you are trying to use a game attribute (purple) for the HP when you should be using a local attribute (blue). Try making a new local attribute for HP and use that instead. Let me know if it still glitches.

ChazDragoon

Jan. 14, 2012

Under rating threshold (show) Upon some messing around..it's something with the HP code..when i removed it i could test my game..when i put it back in..i couldn't. hmm..must of missed something.

+ - !

(1)

ChazDragoon

Jan. 14, 2012

Under rating threshold (show) Hm..strange...after finishing this tutorial i can't even test my game..it just goes through the motions then...dead. Nothing. I restarted Stencyl but still nothing...hmmm

+ - !

(0)

jelmerdokkum

Jan. 13, 2012

Under rating threshold (show) I followed the tutorial but when i click in my game i just start to turn around and the bullets just stay at the player Do you know how this is possible? Love your tutorials! Like the idea how you make them

+ - !

(0)

Developer response from Abigayl

Are you sure you attached the bullet movement behavior to the bullets? If you didn't, they will just stay at your player. If you did, then please screenshot it and send me a link. My livestream (livestream.com/poweredbyflowers) is the best way to reach me for one-on-one help.

iroald

Jan. 09, 2012

Under rating threshold (show) Really helpful tutorials, maybe I'll finally get off my lazy ass and start making a game myself. One thing: the information on how to switch pages in the tutorial is on the 2nd page. Not very practical. I know I can always scroll down a bit for the controls, but I think it's my OCD talking now :P

+ - !

(0)

Developer response from Abigayl

I don't know how to put the controls on the first page without destroying the welcome message... perhaps instead of the Stencyl logo... would need some feedback if that sounds good though. I tried to use the simplest advance controls, ones I would hit personally.

lukabalen

Jan. 08, 2012

Under rating threshold (show) I would like to see and learn how to make a realistic gun. How to add recoil, gravity to bullets, knockback and other stuff.

+ - !

(14)

Developer response from Abigayl

Will keep that in mind for future tutorials, but it's a lot more complicated than this, so might be much later to see if I can even simplify it to a tutorial.

snackman76

Jan. 04, 2012

Under rating threshold (show) best tutorial ever!!!!! i changed up a few things in it and instead of my mouse as the aim and shooter i made my space bar because i learned alot from you. 5/5 just as i rated your other tutorials

+ - !

(9)

Developer response from Abigayl

Thanks Snackman. I'm glad to be able to help :). I'm also happy to hear about people taking my ideas and making them their own. My desire is not to see a bunch of copies but rather people expanding on the ideas I laid out, which it sounds like you are doing.

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