Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
If you're building a game, you need your game agents and characters to move on their own. A standard way of doing this is with 'steering behaviors'.
The seminal paper by Craig Reynolds established a core set of steering behaviors that could be utilized for a variety of common movement tasks. This Ruby library can accomplish many/most of those tasks for your Ruby / JRuby game.
The basic behaviors can be layered for more complicated and advanced behaviors, such as flocking and crowd movement.
The steering behaviors expect to operate on a 'kinematic' thing. That is, the steerable object must expose several required parameters such as position vector, velocity vector, etc. These vectors are altered by the steering force, and then your movement engine simply repositions the object accordingly.
The library supports a variety of steering behaviors. Some of these are the 'canonical' steering behaviors documented at Craig Reynold's website (see References, below). Others are behaviors documented in game programming books or behaviors that I have found useful for my own game programming needs:
This is working, functional software, suitable for use in your own game or application.
Additional steering behaviors, such as flocking and following, are planned.
Watch the changelog for news.
I recommend you clone the Git repository and browse the examples and source code to fully understand how the behaviors work.
But if / when you want to use this in your own project, the easiest way to do so is via the Gem:
gem install steering_behaviors
Then in your code:
require 'steering_behaviors'
The gem is fully namespaced to prevent collisions. See the examples for usage details.
The examples
directory contains working examples of each of the behaviors. The examples themselves are, of course, graphical and leverage Slick2D and JRuby. All the necessary libraries to run the examples are included in this Git repository; you'll just need to install JRuby. (I recommend rvm.)
rvm install jruby
Then, to run the examples:
./examples/run_examples.sh
Note that JRuby is not a dependency for the Steering Behaviors themselves, only for the bundled examples which rely on JRuby / Slick2D for animation.
By the way, the examples are not DRY at all and are highly repetitive from one example to the next; this is by design. They are intended to each be somewhat self-contained and readable without you having to flip between too many files to gain an understanding of what is going on.
FAQs
Unknown package
We found that steering_behaviors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.