Projectiles | Smack Studio Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
to add projectiles to your character you're going to want to start to go to the top right here under projectiles and select new uh for this particular animation I want this robot character to fire a missile so we'll be adding a missile and to do that you'll just click new and here is your projectile I'm going to name it missile actually I'm going to name it bullet so now uh simply click just to the right of the name in this area and you are now in your projectile here the first thing you can do is keep in mind that this little Central ball is kind of where the center of your projectile should be so if you'd like you can start by creating a new Sprite layer and simply drawing the projectile if you'd like but uh I want something more sophisticated than a than what I can draw in this time so I'm actually going to import an existing bullet Sprite that I already have I'm simply going to click it and I'm going to click and drag it right in the right spot kind of make it centered about there that's should be good next we're going to want to add some hit boxes to this so let's go ahead and add a new timeline and select hit boxes and then down here we can select new from this side drop down when it comes to hit boxes for projectiles you can either have the projectile itself do the damage or upon being destroyed the explosion can cause the damage because when this hit box gets activated we're actually going to move on to our Destro destroy animation here and that's what's going to do the damage so I'm probably going to match the hitbox roughly to the size of the bullet here and I'm actually going to zero out each of these values we're also going to add some action so going to actions I'm going to drag this to the top I'm going to click this add action key frame here and I'm simply going to add an effect and we'll use the effect missile Fire trail so we have this little effect going on and we're going to adjust the horizontal offset and the vertical offset so it's a little bit more behind and we'll make sure that it's attached because when this missile is moving we want this to be flashing like this and we'll give this a helpful tag called Fire trail just in case you need to reference it in any kind of variables or anything like that all right so we have the basic projectile here and next onto destroy this will determine in our particular case the Damage Done and the sounds Etc so let's create a new timeline new actions timeline and on this first point here we're going to add an explosion effect so let's look at the list of explosion effects here is there anything called missile explosion let's see what that looks like oh that looks perfect um in terms of the offset Maybe we'll do a slight offset of one and one that should be good and then it will not be attached when it explodes it will explode in place so that looks pretty good uh next we want explosion sound so to do that I'm going to go to the right here and select new sound and I'm going to search for the word explosion that's all right I like explosion two so let's go with explosion two and then lastly we're going to want to clear the player hit flag this will allow for multiple hits all right and then we're not quite done yet uh because uh we have to add the hitbox for this so let's do that let's go to hit boxes go here and add a new hitb boox and we'll just adjust this hitbox a little bit make a little smaller about the size of the explosion that we want we'll call this a damage of six five we'll say 06 here with no sounds or anything related to that because the sounds are already being played here so we don't need anything related to this particular hit box regarding that so then we'll add a let's say after five frames we'll have a empty key frame to cut off that hitbox and then up here on frame five we're actually going to create something that's kind of the one of the more important actions on a projectile and that is remove projectile from game if you do not do this projectiles will linger and linger and linger and that can cause some instability and some unintended side effects so you want to make sure you do that so we kind of set up the basic parameters of our projectile but the most important aspect of projectiles is properties so here you can see we have kind of the characteristics of this projectile how long it will last in seconds whether or not it gets destroyed by hitting the player in this case we do when it activates that first hit box here we want it to go to the destroy animation so we do want that checked for can hit creator that would be something like a grenade where maybe you wanted a risk and reward type situation where if you H the player held on to it for too long it would damage himself him or herself we're not going to worry about that though uh let's add a little bit of a buffer here so there's a basically a period where even if the projectile touches the hurt box of the player it won't affect them that's nice in the beginning so that you know your projectile doesn't automatically hit your own character that that can happen sometimes for damage to destroy we're going to let anything destroy it so the the higher this is the more has to be damaged for it to explode we want really anything to make it explode and we don't really want to affect the ultra fill in this particular case but you can if you'd like stick when hitting player so this would mean if the if the missile or the Bullet in this case hit the person it would stick to them we don't want that and it's not relevant because it gets destroyed when it hits the player anyways for the stage interaction let's set this to about 10 and let's set this to about zero and what that's going to do is this is setting the size of the Collision hit box basically for the projectile and we're going to go ahead and also destroy contact when it goes on the ground but if you check this off it would continue to go along the ground at the speed that you set here so if I turn this off and I set the speed to like I don't know 10 or something the the missile would continue to Glide along the ground and would not be destroyed um then you have two options here you have either physics based movement and you have propulsion these are two different kinds you can have them on at the same time but we don't recommend it because physics based movement is something like granite's Boulder where it uses gravity and that kind of it determines the velocity the fall speed the gravity the friction all those things apply here in this case since we're using a missile or a bullet we are not going to do that so we're going to do a slight d we'll do 0.4 negative for acceleration in the air we'll set that to zero maybe Max speeds like around 8 something minimum speed maybe around five something like that all right so now our projectile here is taking shape I'm going to go ahead and save all right so we have our projectile created we have basic deal for our bullet here active so what we're going to do now is we're going to add that to an animation so in this case I want it to activate during this animation just around here where he's glowing and I'm going to select this and already I've got this effect that I've added and this sound that sound here and one thing I would mention too is I have an offset here so if I were to zero this out you can see the offset's kind of not in the right spot so you might want to experiment and make sure the effect that you're applying lines up with your character so once we've set all that up we're going to want to add a create projectile action so let's look for that or I'm sorry not create effect create projectile create projectile this option right here and from the drop down you'll select the projectile in this case it's bullet and what I like to do is I like to match the effect offset and then match that those values to the projectile which basically means that this cord this coordinate here of 140 by 90 where you see this effect that's where the bullet's going to come from so by default it would be kind of the center down here and it wouldn't look quite right but if you're able to kind of eyeball it with this effect then you can figure out oh I want the projectile to come from there so we now have created a projectile we have now told it to exist at this particular frame here so let's save and test it out all right so let's try let's press B and try it out now look at that we got ourselves a working bullet projectile pretty good and it works it explodes and makes a sound when it hits the player look at that not bad now if you'd like you can add additional things to it if you wanted to make it a homing attack you can adjust the Homing range the rate and continue to home on the target which means it will always do that until it's destroyed here we have a lifetime seconds of three so it wouldn't last too long anyways but I'm going to turn this off and hit accept so using this logic and all these bits of functionality uh we hope you create all kinds of crazy and unique projectiles thank you for watching
Info
Channel: Smack Studio
Views: 6,975
Rating: undefined out of 5
Keywords: smack studio, platform fighter, fighting game, indie game, pixel art, pixel art generator, creat characters games, create a character, stage editor, stage creator, 2.5 d unrela engine, 2.5 games, 2.5 animation software, pixel art game, competitive platform fighter, create character online, pixel art rotation, rotating pixel art, 3D Pixel Art
Id: HFaJ9HATQuo
Channel Id: undefined
Length: 9min 45sec (585 seconds)
Published: Sat Sep 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.