🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

flowgame

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flowgame

A Node.JS Game Engine

latest
npmnpm
Version
0.0.3
Version published
Weekly downloads
7
-12.5%
Maintainers
1
Weekly downloads
 
Created
Source

FlowJS - A Node.JS Game Engine ✨

Supercharge your Node.JS game development with FlowJS! 🚀 This lightweight and efficient library provides all the essential building blocks for crafting awesome 2D games. It's packed with features to handle rendering, input, sprites, and more!

Features!

  • Asset Management: Effortlessly load and manage textures, sounds, and other game assets.
  • Sprite Rendering: Render sprites with smooth animations, transformations, and even custom shaders for that extra sparkle! ✨
  • Input Handling: Let FlowJS handle keyboard and mouse input, so you can focus on the fun stuff. 🎮
  • Collision Detection: Add physics and interactions between objects with collision detection. 💥
  • Sprites: Extend the Sprite class to create unique sprites with their own behaviors and abilities. 💫

Installation (It's a snap!)

Just simply run:

npm install flowgame

Usage

  • Import FlowJS into your project:
import flow from 'flowgame';
  • Create an Game instance:
class MyGame extends flow.Game {
  async onCreate() {
    //...creation code here...
  }
  
}
  • Load your assets:
await engine.loadAsset('./assets/player.png', 'player');
  • Create your sprites:
class Player extends flow.Sprite {
  onCreate() {
    this.loadTexture("player");
  }
  onKeyPress(key) {
    if (key[0] == "right") this.changeVelocity(1, 0);
    if (key[0] == "left") this.changeVelocity(-1, 0);
    if (key[0] == "up") this.changeVelocity(0, -1);
    if (key[0] == "down") this.changeVelocity(0, 1);
  }
}
  • Load your sprites
async onCreate() {
    //...other creation code here...
    this.addSprite(Player)
  }
  • And start your game!
new flow.Engine({game:MyGame, window:{width:1280, height:720,title:"Game"}});

Changelog

  • July 23, Version 0.0.1, Initial Release
  • July 23, Version 0.0.2, Minor bugfixes for the first version
  • July 25, Version 0.0.3, Major bugfixes for the Game class

Keywords

game

FAQs

Package last updated on 25 Jul 2024

Did you know?

Socket

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.

Install

Related posts