Aiming guideline?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
jag_e_nummer_ett
Citizen
Posts: 52
Joined: Thu May 16, 2013 6:31 pm
Location: Stockholm, Sweden

Aiming guideline?

Post by jag_e_nummer_ett »

Ok so I wish to make a 2D defending game where you control a archer or ballista and fire at incoming units. But for the aiming it would be really useful for some kind of guide that shows you approx where the projectile would go more or less, something like this
Image
So before you even have shot you can see kinda where its going to land
Whats the "best" method for this? At least any method...?
User avatar
Jeeper
Party member
Posts: 611
Joined: Tue Mar 12, 2013 7:11 pm
Contact:

Re: Aiming guideline?

Post by Jeeper »

jag_e_nummer_ett wrote:Ok so I wish to make a 2D defending game where you control a archer or ballista and fire at incoming units. But for the aiming it would be really useful for some kind of guide that shows you approx where the projectile would go more or less, something like this
Image
So before you even have shot you can see kinda where its going to land
Whats the "best" method for this? At least any method...?
That depends a bit on how you made the bullet. Also you should post questions and "help me" stuff in the "Support and Development" Sub forum and not in "General".
User avatar
jag_e_nummer_ett
Citizen
Posts: 52
Joined: Thu May 16, 2013 6:31 pm
Location: Stockholm, Sweden

Re: Aiming guideline?

Post by jag_e_nummer_ett »

Jeeper wrote: That depends a bit on how you made the bullet. Also you should post questions and "help me" stuff in the "Support and Development" Sub forum and not in "General".
the projectiles will vary in speed, damage, and size/design, but i think only speed is relevant to this question.

sorry forgot about that, is there a way to move it or do i remake it?
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Aiming guideline?

Post by micha »

Somewhere in your code you have a function that simulates the bullet for one frame (with dt). Put this into a loop (within one frame) to simulate multiple frames. That way you can for example predict the position of the bullet after one second, after two seconds and so on. Use these points to draw a line.
User avatar
jag_e_nummer_ett
Citizen
Posts: 52
Joined: Thu May 16, 2013 6:31 pm
Location: Stockholm, Sweden

Re: Aiming guideline?

Post by jag_e_nummer_ett »

micha wrote:Somewhere in your code you have a function that simulates the bullet for one frame (with dt). Put this into a loop (within one frame) to simulate multiple frames. That way you can for example predict the position of the bullet after one second, after two seconds and so on. Use these points to draw a line.
Alright I have to try that!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 6 guests