Gun Mechanics

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
Semeon
Prole
Posts: 36
Joined: Tue Jul 12, 2016 1:35 pm

Gun Mechanics

Post by Semeon »

Hey,
I was wondering how to implement bullet mechanics. It would help me if you could give the full code with all of the love function etc. cause I get to study the code and I want to understand it well thanks!
User avatar
MicroMacro
Citizen
Posts: 92
Joined: Fri May 30, 2014 2:30 am
Location: Boston, MA, USA
Contact:

Re: Gun Mechanics

Post by MicroMacro »

Well, I'm no expert. I have made simple gun mechanics before.
It depends on how you want it to work. If you want the bullet to follow your mouse, it's a bit trickier, but there's a great wiki article on how to do that.
https://github.com/ebernerd- where you can find all my work.
User avatar
Semeon
Prole
Posts: 36
Joined: Tue Jul 12, 2016 1:35 pm

Re: Gun Mechanics

Post by Semeon »

Well... that isn't what I was looking for, sadly.
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: Gun Mechanics

Post by MadByte »

Semeon wrote:Well... that isn't what I was looking for, sadly.
Then you should explain what you're aiming for instead - we cannot read your mind. ;)
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Gun Mechanics

Post by zorg »

Nor will we code it for you whole. :3
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Pangit
Party member
Posts: 148
Joined: Thu Jun 16, 2016 9:20 am

Re: Gun Mechanics

Post by Pangit »

To give an idea, if you want to have different guns. You have a table of characteristics for each type you will use in the game. This is loaded when the player equips the weapon or an NPC. You can tweak the modifiers to balance the game. In the game each gun would have its own unique instance in the game world so you could account for things like upgrades and modifications, wear and damage ect.. So that not each instance of the type is the same.

You can make it as realistic/complicated as you want. But you will have more of a simulation than a game then if you go down that route. Plus you model the guns that realistic it places a burden on you to model the rest of the game world in the same way.

if you model the bullet characteristics properly and the environment you will quickly find your game is totally unplayable. In a cover shooter for instance if the NPCs have AK47 or AR-15, and you take cover behind most available cover in a environment, they open up on you even in full cover the player is going to get shredded. Realistic but not so good from a game-play narrative perspective.

Trying to keep track of enemy ammunition levels, get them to reload and replenish in a logical way. That is not a trivial thing to implement and will become an accounting nightmare. I have yet to see a game where the NPCs actually adjust there attack patterns based on ammunition reserves.
User avatar
Semeon
Prole
Posts: 36
Joined: Tue Jul 12, 2016 1:35 pm

Re: Gun Mechanics

Post by Semeon »

Hey thanks I did understand what you were talking about, but I managed to figure another way to implement gun mechanics using controller input!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 50 guests