
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
That's all it is. Let simtega manage your state and scenes while you manage your interface. Primarily intended for text games but maybe one day there'll be a plugin for visual games.
Basically, install simtega with
$ npm i --save simtegalib
import with
import Game from 'simtegalib';
or
const Game = require('simtegalib').default;
make an update function
const update = (type) => console.log("updating ", type);
initialize simtega
const game = new Game(update);
and kick off the game by loading the first scene
game.loadScene({
text: "hello!",
buttons: [
{
text: "button1",
onClick: () => console.log("clicked button1")
}
]
})
you are now ready to start using simtega!
Scenes are the most important part of simtega. Everything it does centers around them and the state (more on that later). Scenes are interacted with in two ways: pushing them into the game with game.loadScene and getting the current scene's properties with game.currentScene.
All scenes are objects with two required properties: text and buttons. text is the description of the scene--what players see when they're in the scene. buttons is an array of button objects, an example of which can be seen above. Scene objects can also contain onEnter and onLeave methods.
Here is an example of a scenes with all properties:
{
text: "This is a scene with onEnter & onLeave methods",
onEnter: () => doSomething(),
onLeave: () => doSomethingElse(),
buttons: [
{
text: "button1",
onClick: () => click1()
},
{
text: "button2",
onClick: () => click2()
}
]
}
That's a scene! For most text games, this is more than enough to create a full game.
When you push a new scene, you'll probably want to update your UI. To facilitate this, your update function will be called with "scene" as the first parameter. Get the parts of the scene in update with game.currentScene, i.e. game.currentScene.text.
In simtega, state for an entire game is in one place. game.setState sets a value and game.getState gets a value. Each value in simtega's state has a path, like a path in your filesystem. There are two root "directories," var (persistent) and tmp (temporary). All subdirectories are created on the fly when you set them. For example, some valid paths include 'var/player/hp' or 'tmp/ui/textBox'.
Other things to note:
'var/player/inventory/0/name'), an array will automatically be used to ease iteration.Like updating the scene, updating the state will trigger a call to your update function, but the type will be "state".
Include an array of plugins as the second parameter to the Game constructor after following the plugins' instructions.
Example:
import Game from 'simtegalib';
import Static from 'simtega-plugin-static';
import scenes from './scenes.json';
import utils from './utils';
const game = new Game(update, [new Static(scenes, utils, true)]);
FAQs
Lightweight game framework that manages internals while you build the interface
We found that simtegalib 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.