I've made a few minor changes to my game to get things to work. I changed how the bullet moves, it used to get force added from the troop. that made it very difficult to make spread and I didn't need to go through that when all I had to do was make the bullet add force to itself, so it can go into direction. the code looks a bit like this
public void Forced(int force)
{
Rigidbody2D rb = GetComponent<Rigidbody2D>();
rb.AddForce(gameObject.transform.up * force, ForceMode2D.Impulse);
}
force is a variable given by the troop itself.
now I have to find a formula to find out how long to bullet has to be alive before I delete it to math out range. I could just wing it, throw in random values, but that's a bit tricky because the distance would depend on the force added. sounds like a lot of work I really don't want to do.
on a side note, I bought my first cd, System Of A Down, Toxicity. That's kind of all I've been listening to. I need to buy more CDs so I can listen to them while I program, lol.
I'm a tiny bit worried for the troops I am trying to add, because I need to do WAY more work, then I also plan on adding a few particle systems because right now, when a troop dies, they just VANISH . it would be nice to add just a bit more of an effect. at the same time I'm worried, my laptop is a bit old. only has a few GB of ram (just 3 or 4 Y.Y ), so my PC might just vaporize on the spot .
I wish I could just procrastinate with this all day but I should get back to programming. if your reading this, then I guess you found this mildly interesting so thank you for this. if you can, follow my game, maybe me if you really want to.
I have a twitch, if you want to watch my annual stream lol...
https://www.twitch.tv/the_iicrazykingg
thank you again!
β‘ iiCrazyKingg
0 comments