1 (edited by kianoosh 2017-07-16 16:37:40)

Hi guise. Today i decided to give one of my old games a try and decided to code some interesting stuff like a sniper. Well i did this and everything worked well, except the moving which is used from bgt rotation package written by sam tupy.
In this system that i wrote for the sniper, player presses l, selects a target, then they can press enter to track the target or hold down left shift key and press enter to get the angle for the target between the player itself and that target, then they can press alt to set their facing based on that angle. For example if the angle is 50 and their facing is 45,  When they press the alt key, there facing will be 95 (Means 45+50=95). But the problem is here. When they fire their gun, The bullets moves and each tile it passes, it doesn't stay on the coord that i told the program to move bullet based on that. The same problem with player's movement and the movements are all used that move function in rotation package. To be more clear, Here is what i did:
bullets left braket i right braket .location=move(bullets left braket i right braket .location.x, bullets left braket i right braket .location.y, bullets left braket i right braket .location.z, facing, 0.0);
I did replaced [ and ] with left braket and right braket to avoid forum errors.
Am i doing something wrong? Or did i forgot or didn't include something?
Or this is the problem of that rotation package. If so, Could anyone please give me a fixed version or something?
Thanks for reading.

Thumbs up

Two questions.  First, it looks like, based on the little I see, that the bullets are in an array.  Is that correct?  Second, would it be possible for me to see the actual code you've written...not the whole code, obviously, just the sections that you're referring to, as well as the code for the rotation packet, please?

Thumbs up

Rotation package is at samtupy.com developer resources page, And I already wrote the code in the first post, That's what moves the bullet based on the direction

Thumbs up

Code in the first post wasn't written the way in would be in BGT, since there are spaces and such where you spelled out punctuation and things.  I'd prefer to see the actual way it was written in BGT.  Easier for me to spot issues that way.

Thumbs up

5 (edited by kianoosh 2017-07-16 22:35:34)

Do you have a skype id so i can send it to you

Thumbs up

jwmckinniss is my Skype ID.  Not sure if I listed it in my profile, need to go see.

Thumbs up

One solution is rounding the new positions, but isn't the best at all.

Thumbs up

I did that already.

Thumbs up