2017-12-09 07:44:02

Hi all.
I'm intrasting, how create bullet class.
I develop the game in C#. I need bullets. But I don't know formulas, algorithm.
Please help me!

2017-12-09 14:23:07

It's importante to define a direction that your bullet will travel constantly during it's automatic movimentation. It will depend on your game's movement type. If it's without rotation, use vectors.

2017-12-11 16:08:39

BTW I always wanted to get access to ectors but honestly I couldn't. Which library should I use??

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2017-12-11 23:23:56

About C Sharp i don't know but probabbly there's vector suport.

2017-12-12 01:12:12

System.Numerics.Vectors, perhaps?

I'm not sure if you'd want each bullet to be an object, would you? It depends how many bullets you expect to be spat out. But I'd say a bullet's extremely short lifespan would mean you don't want thousands of bullet objects sat around waiting for garbage collection. In any language.

With one potential exception, that is, and that's if you want bullets that last a little longer, ricocheting around and bouncing off things and doing crazy stuff like that. In that case, and if they're the exception rather than the norm, it might be okay to have them as a class.

HTH

2017-12-12 02:05:50 (edited by cartertemm 2017-12-12 02:06:54)

Porting BGT vectors would not be very hard, as it’s pretty much just variables and operator overloading

2017-12-13 01:11:14

I really have to try this thing. Vectors are really handy when it comes to game creation. The last bullet system i wrote came as an object. Actually a class and it's veriables, and a list which contains the class itself (I mean the list <>) and a checkloop or what ever you call it in the main class I wrote it like the bullet system in bgt where if that hits a wall or something, It removes from the list. Although i think this way is a real mess. Do any of you have any ideas about calling functions and such from the main form, one of the class functions i mean(Not the main class). I don't know how to explane it better but if you know how to do that, let me know please..., I tryed sevral ways like form1.sound but that didn't work.

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988