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
1 answer

Fixing projectile motion formulas in python

The code outputs a graph that is nowhere near what you'd expect of a projectile motion type of graph. In addition, if you change the step number to around 2, the graph doesn't output much of anything. import numpy as np import matplotlib.pyplot as…
hero7209
  • 3
  • 2
0
votes
2 answers

Unity - Projectile Motion, find the angle needed to hit coordinates x,y

Plenty of questions asked around the same topic, but nothing seems to be working for me. The problem is simple, a player and an enemy are on the x,y plane. I want to launch my projectile at a calculated angle in such way that the projectile will…
vtkr
  • 1
  • 1
  • 2
0
votes
1 answer

is there a different loop i can use to execute this, and how do i make it a function?

Soccer ball kicked projectile motion objective function is (2 * (v0)^2 * sind(a) * cosd(a)) / g) using golden search method we must create a program that maximizes the x-distance by choosing an angle for any user-defined initial velocity by the…
student22
  • 3
  • 1
0
votes
0 answers

How to maximize distance with a user input initial velocity

A soccer ball is kicked, create a function that maximizes the x-distance by choosing an angle for any user-defined initial velocity. the question asks to: a) create a function with at least the following inputs v0, and x(a) b) Find the maximum value…
student22
  • 3
  • 1
0
votes
2 answers

AttributeError: 'list' object has no attribute 'get_zorder'

I'm trying to animate projectile motion with the help of matplotlib.animation but I've been facing a few errors. Please help me with this. Thank you so much I've tried searching through the internet and I did implement solutions of a few similar…
Rohit Imandi
  • 1
  • 1
  • 1
0
votes
3 answers

Share variables between classes C++?

Yet another question about classes as Im new to OOP. I am creating a game just for fun. Its a top down shooter, space shooter. I have a few different classes: Bullet (a list of bullet coordinates), Player (player sprite, position etc), Enemy (enemy…
Jesper
  • 27
  • 1
  • 3
0
votes
1 answer

JAVA Efficient way to draw bullets firing from character to mouse position?

I'm creating a 2d game and I wanted to implement shooting. However, bullets for some reason shoot only at a -45° angle. Provided below is my code. The if statement is also important and needs to know when the bullet goes out of range. I've looked up…
geger42 _
  • 15
  • 5
0
votes
1 answer

Unity3d Quaternion LookRotation not returning proper value

I wanted a projectile to look at the target object, to do that I am using Quaternion LookRotation as below targetRotation = Quaternion.LookRotation(targetPosition - projectile.transform.position); if(targetRotation.eulerAngles.magnitude <= 60) …
Ashok Damani
  • 3,896
  • 4
  • 30
  • 48
0
votes
2 answers

How can I get Emacs Projectile to operate like VScode's "C-p" ?

I have installed Projectile on my emacs26 installation. My configuration looks like as below: (projectile-mode +1) (define-key projectile-mode-map (kbd "s-p") 'projectile-command-map) (define-key projectile-mode-map (kbd "C-c p")…
Caleb Jay
  • 2,159
  • 3
  • 32
  • 66
0
votes
1 answer

Need help making a sphere move in parabola as part of a projectile simulator?

Hi I'm currently working on a school computer science project for which I have decided to make a simple projectile simulator, where the user just provides the initial launch speed, the launch angle, and gravity. So far I've tried to make a script…
DCStega
  • 13
  • 2
0
votes
0 answers

Projectile motion with user specified angle and speed using RigidBody2D

Edited: I've got a slider from 0-90 for the user to select an angle, and a text field for them to enter a speed. All vids I've seen either have people using their own physics or are retrieving an angle directly from the angle of the "gun" or the…
0
votes
0 answers

Projectile Physics mechanic broken java

For my game to become engaging I want the enemy to fire bullets at the mothership and the player. However I am running errors whenever I uncomment out the physics mechanics that I wrote in each class. Here is the one for the player as…
Beatenberg
  • 15
  • 8
0
votes
3 answers

Multiple movieclips all go to the same spot; What am i doing wrong?

So I'm trying to shoot multiple bullets out of my body and it all works except I have an odd problem of just one bullet showing up and updating to set position for the new ones. I have a move able player thats supposed to shoot and I test this code…
Xenland
  • 510
  • 1
  • 6
  • 19
0
votes
1 answer

Projectiles In Gamemaker Studio 2 Not Moving

My gun's begin step code: if (global.night == true) { image_angle = point_direction(x, y, mouse_x, mouse_y); image_index = 1; alarm[0] = 0.5 * room_speed; firingdelay -= 1; if (mouse_check_button_pressed(mb_left)) &&…
0
votes
1 answer

Instantiate is only working sometimes in unity

I'm having a bit of an odd issue in a 2d side-scroller game, where unity is only creating my projectile clone sometimes when pressing fire, it removes 1 grenade from the inventory correctly regardless of if the grenade is cloned or not. here is my…