# In a 2D top-down game, how can I create projectiles that have a height?

A 2D game called Deer Hunter has projectiles like this:

Are the projectiles 2D or 3D models? How could I implement something similar?

• Why did it even occur to you if these were 3D models? They seem undersampled 2D images with point sampling filter (I assume that because they are displayed differently after rotation). Commented Apr 21, 2015 at 18:57
• i'm quite inexperienced in game development, but it looks like those arrows are just some different textures for an arrow pointing at different angles, with the time and position traveled determined by some (probably simple) math. it's still possible that they could be implemented with 3d graphics, but not that probable. Commented Apr 21, 2015 at 19:25
• There is almost no way they used 3D models for this. Instead it would just be custom functions that rotate the arrow based on the firing direction and then a little custom animation for them landing. Commented Apr 21, 2015 at 23:22
• Guys, those 3 comments are 3 great candidates for answers to this question, regardless of how trivial the question seems to you. Commented Apr 22, 2015 at 0:45
• Does anyone happen to have a link to that game? Apparently there are tons of games called Deer Hunter, so Google is yielding nothing.
– Anko
Commented Apr 23, 2015 at 11:48

I've made projectiles like this in a game and they are most likely 2D for all purposes besides selecting the correct sprite. Then a third Height variable is maintained and some simplified physics is applied. This variable might even be "time in air". So they are likely represented in 2D (x,y) and animated using a third tertiary variable

3D models for something that uses minimalist art is completely overkill. The arrows' effects are most likely produced by 2D art and some math.

First, the arrows are given a rotation based on the angle that the player makes with the mouse, upon release of the left mouse button.
Then, based upon how long the mouse button was held, the arrows are given a flight time.
Finally, upon reaching the end of their flight time, the arrows will be animated to angle toward the ground and have their height reduced by a small amount.

Once again, this is, or at least should be, done with 2D art that is rotated based upon the angle being shot at.

By speculation - this is what it looks like to me.

• The arrows seem to, as others say, have an extra variable to determine their height. It looks like an X and Y velocity of the dart might be determined by the direction and power of the power bar, with a predetermined height. I'm not sure if the darts are shot at an upward angle. If not then the flight time for every dart would be constant.
• I would expect there would also be a height velocity variable that would be set to the power of the power bar / some constant, or 0 if the darts are shot straight with no upward angle. It looks to me as if the dart might be some sort of rotated bitmap - but it could also likely be an extremely simple texture with its pixels calculated per frame based on angle. I'm not sure exactly how they did it - but I'd figure not with models. There's only so many pixels to work with anyway, so an approximation will look very similar to a pixelated model. So why do it with models?
• It looks like the X position of the arrow is unaffected by its height. I'd say that the Y position is simply set to its calculated Y position (technically Z position in a 3D world) minus its height value. The angle of the actual dart appears to be determined by the change in the dart's X position and the change in the dart's Y (and height) position, while the shadow is simply a brown (or black semi-transparent) dart that follows the same path as the "3D" dart except without any height.

I'd say that this game (and the darts) should be and probably is made in 2D because:

• Calculating and pixelating 3D models for such a simple game would be a waste of processing power, let alone being overkill.
• The techniques here look very much like 2D game techniques. Besides, pixel games are usually 2D anyway.
• Look at the way the dart sort of "blips" through the tree. I don't think that would be acceptable if the models were 3D.
• The game itself has no perspective. If the darts were 3D models then I would assume they'd be in a 3D world. So then why is there no perspective at all, really?

Anyway, this is all mostly speculation - but hey, you asked us to look at a gif and tell you how we think it was done, so I guess speculation is okay. :P

Although, despite this being speculation, I think it's actually how the game should be done if it was not already done this way. Although there's plenty of other answers here and I'd say any of them would probably work well. Eh, I hope this answer helps you some way. :)