Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying JMonkeyEngine 3.0 Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
JMonkeyEngine 3.0 Cookbook

JMonkeyEngine 3.0 Cookbook

By : Rickard Eden
4 (7)
close
close
JMonkeyEngine 3.0 Cookbook

JMonkeyEngine 3.0 Cookbook

4 (7)
By: Rickard Eden

Overview of this book

If you are a jMonkey developer or a Java developer who is interested to delve further into the game making process to expand your skillset and create more technical games, then this book is perfect for you.
Table of Contents (12 chapters)
close
close
11
Index

Firing in FPS


There are several ways to perform firing, and the requirements depend heavily on the type of game. This recipe will start off with the basics, which can then be extended to support the different forms of firing. We'll create the necessary functionalities to fire instant bullets; they are performance-friendly and suitable for a fairly close-quarters FPS.

Getting ready

This example will be based on GameCharacterControl and InputAppState from the Creating a reusable character control and Attaching an input AppState object recipes of this chapter, respectively. Familiarity with the recipes is beneficial. Further, we'll use the Ray class in combination with CollisionResults to check whether the bullet has hit anything or not.

Rays can be imagined as infinite lines and are very common in game development. This is a fast way of detecting intersections with game objects and is thus suitable for instant firing. The targets might consist of any kind of spatial. In this case, it's a bunch...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
JMonkeyEngine 3.0 Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon