A projectile is an object that is propelled by the application of an external force and then moves freely under the influence of gravity and air resistance.[1][2] Although any objects in motion through space are projectiles, they are commonly found in warfare and sports (for example, a thrown baseball, kicked football, fired bullet, shot arrow, stone released from catapult).[3][4]
Blowguns and pneumatic rifles use compressed gases, while most other guns and cannons utilize expanding gases liberated by sudden chemical reactions by propellants like smokeless powder. Light-gas guns use a combination of these mechanisms.
Some projectiles provide propulsion during flight by means of a rocket engine or jet engine. In military terminology, a rocket is unguided, while a missile is guided. Note the two meanings of "rocket" (weapon and engine): an ICBM is a guided missile with a rocket engine.
An explosion, whether or not by a weapon, causes the debris to act as multiple high velocity projectiles. An explosive weapon or device may also be designed to produce many high velocity projectiles by the break-up of its casing; these are correctly termed fragments.
Many projectiles, e.g. shells, may carry an explosive charge or another chemical or biological substance. Aside from explosive payload, a projectile can be designed to cause special damage, e.g. fire (see also early thermal weapons), or poisoning (see also arrow poison).
Kinetic weapons are the oldest and most common ranged weapons used in human history, with the projectiles varying from blunt projectiles such as rocks and round shots, pointed missiles such as arrows, bolts, darts, and javelins, to modern tapered high-velocity impactors such as bullets, flechettes, and penetrators. Typical kinetic weapons accelerate their projectiles mechanically (by muscle power, mechanical advantage devices, elastic energy or pneumatics) or chemically (by propellant combustion, as with firearms), but newer technologies are enabling the development of potential weapons using electromagnetically launched projectiles, such as railguns, coilguns and mass drivers. There are also concept weapons that are accelerated by gravity, as in the case of kinetic bombardment weapons designed for space warfare.
Alright, I have an idea for a 2D top-down game that involves the player firing projectiles that can ricochet off of walls. But the walls will be sprites. I tried this block:
But that seems to only work for making it ricochet in the vertical direction.
So, how can I make the projectile's direction change to reflect off of both vertical and horizontal walls/sprites, especially having it communicate with the wall it's reflecting off of so that it knows which side it's hitting?
To keep it concise, I want an algorithm that works like the "if on edge, bounce" block that's built in to Snap*!*, but it works on things other than the end of the screen. Think of it like the Wii Play "Tanks!" game, if you will (and you know what that is).
Just letting you know, it is pretty complicated, which is why it's not built into snap. Don't worry though, I want to figure this out too. I did find this Bouncing Algorithm 101 Computing which may help a little. Although, I am thinking of much simpler way. I'll see if I can make it, then share it (I just don't know how to explain it)
It works, but touching color is slow, and it sometimes gets stuck on corners. I don't have time now, but when I make it I would use one sprite for horizontal, one for vertical, and one sprite and clones for corners.
When a light beam bounces off a mirror (specular reflection), the rule is that the angle of incidence equals the angle of reflection. The same is true for a hard object bouncing off another hard object. The angles are measured relative to a line perpendicular to the mirror. (It could also be done relative to the mirror itself, if the mirror is flat, but the perpendicular is well defined even if the mirror is curvy.)
So your sprites have to know the slope of their perpendiculars. In Snap! this turns out to be the usual thing to measure, since mostly-vertical shapes such as people, animals, and buildings start out facing to the right, which is perpendicular to the vertical shape. If you have only horizontal and vertical lines, you can use the special case formulas given above; if you also have diagonal lines, each sprite has to know its DIRECTION, which it does. Then the new DIRECTION of the bouncing sprite is
untitled script pic1318126 30.6 KB
I am not sure what exactly you mean. Do you mean the wall itself?
I looked at the collision properties of the wall, and everything seems correct. It is supposed to block the Projectile.
Here is an image of this (you can see the selected wall and the collision properties):
Hello,
Well, the Walls and floor used are the walls and floor in the 3rd Person template in the example level.
I examined the mesh which belongs to the wall and it has a collision. I also deleted that collision and added a new simple box collision. That changed nothing.
Here is an image of the mesh in the editor:
I could solve this error. But the cause seems very strange to me.
I deleted the Base class and created a projectile which is just a subclass of Actor. Then I set up everything as before and it worked.
Did you solve this? I am having this issue with the static meshes from the Infinity Blades package. My enemies (prefabs from the Shooter Game demo) shoot through everything, even though they have collision and Block set for projectiles.
You are my hero, I was searching for hours but setting the collision to the root of my projectile made id work! (I have a projectile setup like in the twin stick shouter tutorial)
Overlap with other pawns worked. But I could make it generate hit events when hitting was. This is needed because fast traveling bullets will not allways generate the overlap event.
In Unit 1 of the Physics Classroom Tutorial, we learned a variety of means to describe the 1-dimensional motion of objects. In Unit 2 of the Physics Classroom Tutorial, we learned how Newton's laws help to explain the motion (and specifically, the changes in the state of motion) of objects that are either at rest or moving in 1-dimension. Now in this unit we will apply both kinematic principles and Newton's laws of motion to understand and explain the motion of objects moving in two dimensions. The most common example of an object that is moving in two dimensions is a projectile. Thus, Lesson 2 of this unit is devoted to understanding the motion of projectiles.
A projectile is an object upon which the only force acting is gravity. There are a variety of examples of projectiles. An object dropped from rest is a projectile (provided that the influence of air resistance is negligible). An object that is thrown vertically upward is also a projectile (provided that the influence of air resistance is negligible). And an object which is thrown upward at an angle to the horizontal is also a projectile (provided that the influence of air resistance is negligible). A projectile is any object that once projected or dropped continues in motion by its own inertia and is influenced only by the downward force of gravity.
By definition, a projectile has a single force that acts upon it - the force of gravity. If there were any other force acting upon an object, then that object would not be a projectile. Thus, the free-body diagram of a projectile would show a single force acting downwards and labeled force of gravity (or simply Fgrav). Regardless of whether a projectile is moving downwards, upwards, upwards and rightwards, or downwards and leftwards, the free-body diagram of the projectile is still as depicted in the diagram at the right. By definition, a projectile is any object upon which the only force is gravity.
Many students have difficulty with the concept that the only force acting upon an upward moving projectile is gravity. Their conception of motion prompts them to think that if an object is moving upward, then there must be an upward force. And if an object is moving upward and rightward, there must be both an upward and rightward force. Their belief is that forces cause motion; and if there is an upward motion then there must be an upward force. They reason, "How in the world can an object be moving upward if the only force acting upon it is gravity?" Such students do not believe in Newtonian physics (or at least do not believe strongly in Newtonian physics). Newton's laws suggest that forces are only required to cause an acceleration (not a motion). Recall from the Unit 2 that Newton's laws stood in direct opposition to the common misconception that a force is required to keep an object in motion. This idea is simply not true! A force is not required to keep an object in motion. A force is only required to maintain an acceleration. And in the case of a projectile that is moving upward, there is a downward force and a downward acceleration. That is, the object is moving upward and slowing down.
To further ponder this concept of the downward force and a downward acceleration for a projectile, consider a cannonball shot horizontally from a very high cliff at a high speed. And suppose for a moment that the gravity switch could be turned off such that the cannonball would travel in the absence of gravity? What would the motion of such a cannonball be like? How could its motion be described? According to Newton's first law of motion, such a cannonball would continue in motion in a straight line at constant speed. If not acted upon by an unbalanced force, "an object in motion will ...". This is Newton's law of inertia.
Now suppose that the gravity switch is turned on and that the cannonball is projected horizontally from the top of the same cliff. What effect will gravity have upon the motion of the cannonball? Will gravity affect the cannonball's horizontal motion? Will the cannonball travel a greater (or shorter) horizontal distance due to the influence of gravity? The answer to both of these questions is "No!" Gravity will act downwards upon the cannonball to affect its vertical motion. Gravity causes a vertical acceleration. The ball will drop vertically below its otherwise straight-line, inertial path. Gravity is the downward force upon a projectile that influences its vertical motion and causes the parabolic trajectory that is characteristic of projectiles.
c80f0f1006