Jump to content
  • entries
    941
  • comments
    5,894
  • views
    867,734

Weapon switching logic


Josh

2,870 views

 Share

I'm working to add weapon switching to the player script. A weapon in the map consists of two important parts. First, you need a pickup weapon that tells the player they have a certain item. Second, you need the visual weapon that is displayed onscreen, along with the various settings that make that weapon unique.

 

It's a simple thing to program, but I'm trying to make it as easy as possible for the user to manage, so people can add new weapons and have them work with no tinkering and adjustment required. Usually that means trying a few different approaches and then deciding which is best.

 

blogentry-1-0-69816700-1412184691_thumb.jpg

 

I like working on high-level stuff like this. Having a good shotgun blast is very satisfying, and makes my map suddenly feel like a "real" game. (I used the new sprite entity to make the visible pellets.) This kind of stuff is why I got into game development, and I hope to work on more practical and fun things like this over the next year. I want Leadwerks to be an extremely high-level system, but to have the ability to drill down to the next layer when you need to. More pre-made reusable functionality you can use or modify to your heart's content.

 

  • Upvote 2
 Share

3 Comments


Recommended Comments

I added some behavior to make the player put their weapon down when they are in front of a wall. As a result, you can be easily killed if you get surrounded by enemies, because you can't shoot at them! Which is probably pretty realistic, but unexpected.

  • Upvote 3
Link to comment

Well, then we need a stumble animation for every single character we ever use, which is a fairly rare thing. So I will try to avoid that.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...