Questions tagged [projectile]

A projectile refers to an object, point type or solid, that was launched into an orbit or ballistic trajectory and is typically traveling at high velocity.

A projectile refers to an object, point type or solid, that was launched into an orbit or ballistic trajectory and is typically traveling at high velocity.

252 questions
0
votes
4 answers

Can't get bullets to shoot at correct angle?

I've been having some trouble with trying to get a bullet to fire at angle that I put in. I am using eclipse with java. My code: x += (int) (spd * Math.cos(dir)); y -= (int) (spd * Math.sin(dir));` The feel like the reason it's not working is…
mkjrfan
  • 77
  • 1
  • 8
0
votes
3 answers

Creating a "bullet" class (Java/swing)

I'm trying to create a Tower Defense style game, where the object is to stop the attacking forces from reaching their target. This is done by building towers, which attacks the waves of enemies with different kinds of attacks. As I am new to…
0
votes
2 answers

Create a parabolic trajectory with fixed angle

I'm trying to throw an arrow in my XNA game, but I'm having a hard time trying to realize a good parabola. What I need: The more you hold Enter stronger the arrow goes. The arrow angle will be always the same, 45 degrees. This is what I have…
Moondustt
  • 864
  • 1
  • 11
  • 30
0
votes
2 answers

How to enable shooting using angles?

Sitting and making a 2d shooting game where my player needs to be able to shoot up left and up right using angles. The problem I have is I can't find a way to make this work. So how do I calculate the angle to shoot the bullet a specific angle? My…
0
votes
2 answers

How do you switch between files when using prelude's projectile?

Imagine you have these files in your project: a/b/first.png a/first.png If I trigger projectile with C-c p f and write first.png, and I write first.png , it will show me both files. Is there a way to select the next file? Example: In the image…
Geo
  • 93,257
  • 117
  • 344
  • 520
0
votes
2 answers

C++ vector erase crashes program

My program creates projectiles that move forward, if they go out of certain bounds, they are to be deleted from the vector that they are stored in. The vector stores xcord, ycord, zcord, and their respective directions. int size = bullet.size(); …
0
votes
1 answer

Implement a projectile motion and collision detection - response in a 2D top-down game

There are a lot of examples concerning projectile motions in 2D games. But, what are the equations for implementing a projectile motion on a 2D top down view game? For example, we want to kick a ball and increase its height (just like sensible…
Puma
  • 135
  • 1
  • 12
0
votes
2 answers

Getting bullet X to Y movement ratio from 2 points

I'm making pretty simple game. You have a sprite onscreen with a gun, and he shoots a bullet in the direction the mouse is pointing. The method I'm using to do this is to find the X to Y ratio based on 2 points (the center of the sprite, and the…
user2029675
  • 245
  • 3
  • 9
0
votes
2 answers

How do you assign a per second limit on a paint method in java which repaint itself based on resource availability?

I'm somewhat new to creating games in Java, however my current setup is such that the FPS on the paint method is bounded only by the system. So, my FPS tends to be between 300 and 450. In order to standardize movement speeds on objects, I've been…
fvgs
  • 21,412
  • 9
  • 33
  • 48
0
votes
1 answer

How do I accomplish a 2D Isometric Projectile (3D) Rotation Effect

I am working on an isometric 2d game and one aspect of it will be units that shoot projectiles. If the projectiles are circular its not to bad. Just position the projectile in isometric space. But what if the projectile is long like a missile or an…
MurderDev
  • 157
  • 1
  • 10
0
votes
1 answer

Projectile Motion with Drag Force Matlab

I'm trying to model projectile motion with air resistance. This is my code: function [ time , x , y ] = shellflightsimulator(m,D,Ve,Cd,ElAng) % input parameters are: % m mass of shell, kg % D caliber (diameter) % Ve escape velocity (initial…
Erica
  • 105
  • 6
  • 13
0
votes
1 answer

Making copied images all rotate independently

I think my issue has something to do with deep vs. shallow cloning, which I have not really worked with before, and cannot seem to understand by reading articles(You can tell I'm not a professional programmer). This is a small game I am making and…
Vynlar
  • 55
  • 1
  • 7
-1
votes
1 answer

How to fire on Mouse Button?

I'm trying to do my first platformer at Unity. And have some problem with projectile. I found a tutorial, how create a projectile moving, but without trigger on Fire button. It is possible to change this script for firing on button? I tried to make…
-1
votes
1 answer

Hittesting works fine but setting values to the same object results in error?

Im working on shooting some bullets and the collision testing works perfectly fine it even hurts the zombies. Except the one problem, i want the bullets to disappear when they hit a zombie this sounds easy sense Im already hit testing inside the…
Xenland
  • 510
  • 1
  • 6
  • 19
-1
votes
2 answers

How to apply gravity to a projectile that has directional velocity?

I have a bullet that fires at an angle. I want the bullet to react to a gravitational force. The following code is in the update function of a bullet. this.pos.x += Math.cos(this.angle * Math.PI/4) * (this.vel.x); this.pos.y += Math.sin(this.angle…
Kake
  • 62
  • 5
1 2 3
16
17