Hi,
I need your help to understand a part of the coordinate system.
At the moment, if the player shoots, the bullet goes exactly to the x/y-coordinate where the mouse was clicked.
But I wanna the bullet going outside of the window (1024x768 pixels), so I can delete it.
My question:
Assumed the player shoots at 500/600.
The y-coordinate of the bullet has therefore to be at least -600. But the x-coordinate has to change too, relative to the y-coordinate.
On 1024x768 the ratio is 4:3. What would be the target coordinates?
Aww, I'm bad at explaining problems. Especially in English.
This image could help:
http://www.abload.de/img/problemd3l12.jpg
I still suck at math, I hope it changes.
Greets
Understanding part of the coordinate system
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Understanding part of the coordinate system
"Docendo discimus" - Lucius Annaeus Seneca
Re: Understanding part of the coordinate system
i don't quite understand what you want...
you want to get the coordinates of the target point? (based on image)
if yes you can check in the update() if the x and y coordinate is out of the window and then get the other one...example:
-- suppose the window is 700x800
but if you want just to delete the bullet you need to check if only one coordinate (x or y) is out of the window!
hope it helps
you want to get the coordinates of the target point? (based on image)
if yes you can check in the update() if the x and y coordinate is out of the window and then get the other one...example:
-- suppose the window is 700x800
Code: Select all
if x >= 700 then
y = get-bullet-y-coordinates
elseif y >= 800 then
x = get-bullet-x-coordinates
end
hope it helps
Re: Understanding part of the coordinate system
I forgot to say that the bullet doesn't go that way. That's the way it should go.
As I wrote, the bullet at the moment goes exactly to the point where the mouse was clicked.
And based on the image, I would like if someone could say me what the coordinates are and how he was able to figure them out.
As I wrote, the bullet at the moment goes exactly to the point where the mouse was clicked.
And based on the image, I would like if someone could say me what the coordinates are and how he was able to figure them out.
"Docendo discimus" - Lucius Annaeus Seneca
Re: Understanding part of the coordinate system
the shooter is in 500/600 right?
the target is in the question mark?
the bullet doesn't follow the red line?
you want the coordinated of the mouse click?
sorry for not understanding
the target is in the question mark?
the bullet doesn't follow the red line?
you want the coordinated of the mouse click?
sorry for not understanding
Re: Understanding part of the coordinate system
The player clicked at 500/600. The bullet goes to 500/600.clepto wrote:the shooter is in 500/600 right?
the target is in the question mark?
The question mark stands for the coordinates I want to know.
No, therefore I asked how to get the coordinates where the question mark is, so I can move the bullet to those coordinates.clepto wrote: the bullet doesn't follow the red line?
Sorry for not writing in correct english.
"Docendo discimus" - Lucius Annaeus Seneca
Re: Understanding part of the coordinate system
english is not my first language either
we know the x coordinates, its the x size of the window...
the y now...hmm..thats diffucult
can i ask something? the player clicked in 500/600 so the bullet has to go there...from where does the bullet start? why you need this coordinates?
we know the x coordinates, its the x size of the window...
the y now...hmm..thats diffucult
can i ask something? the player clicked in 500/600 so the bullet has to go there...from where does the bullet start? why you need this coordinates?
Re: Understanding part of the coordinate system
May ask where you are from?clepto wrote:english is not my first language either
I don't understand.clepto wrote: we know the x coordinates, its the x size of the window...
Surely easy math.clepto wrote: the y now...hmm..thats diffucult
The bullet starts from the player x/y coordinate. Basically I need these coordinates to let the bullet fly outside the window.clepto wrote: can i ask something? the player clicked in 500/600 so the bullet has to go there...from where does the bullet start? why you need this coordinates?
Deleting them while flying doesn't look that good.
"Docendo discimus" - Lucius Annaeus Seneca
Re: Understanding part of the coordinate system
I am from Greece
look at the image here http://ubuntuone.com/5LdkdGaRtE0TR4vX3SEiq3
i hope it helps a bit
look at the image here http://ubuntuone.com/5LdkdGaRtE0TR4vX3SEiq3
i hope it helps a bit
Re: Understanding part of the coordinate system
Oh, greets to Greece.
Heh, I think we understand ourselves not correctly.
I think it's better to wait also here until someone comes.
Heh, I think we understand ourselves not correctly.
I think it's better to wait also here until someone comes.
"Docendo discimus" - Lucius Annaeus Seneca
Re: Understanding part of the coordinate system
haha thats what i was thinking
edit: just one more thing, why you need specific coordinates to get the bullet out of the window? just keep increasing the coordinates and check if its out of the window! Goodnight!
edit: just one more thing, why you need specific coordinates to get the bullet out of the window? just keep increasing the coordinates and check if its out of the window! Goodnight!
Who is online
Users browsing this forum: Roland Chastain, slime and 197 guests