btco / qx82 Goto Github PK
View Code? Open in Web Editor NEWTiny Javascript engine for retro games
License: MIT License
Tiny Javascript engine for retro games
License: MIT License
I'm developing a small choose-your-own-adventure example to learn how to use qx82 and the only way I've gotten animated images is by using 90 to 100 separate frames for a simple background animation using qx.frame.
Is there a way to load animated images that are not JPG or PNG?
Hi there, not sure if this is a known issue, but I noticed when loading the examples "Overworld" and "Menu" in Firefox, below is how they first render until a key is pressed. I noticed that this issue only happens on very first render/load, so if you refresh the page it's fine, but if you clear all site data and then refresh, this bug happens again. Nothing appeared in the Inspect console so not sure what could be causing this. Love this project btw!
This is great fun :) I had a blast creating a little starfield effect and a small game.
I think it would be a really nice idea to allow users to create custom characters. This is very in keeping with retro systems, where you could often redefine the pixels of character sets.
Rather than go to that extreme, I think it'd be great to be able to pass an array of 0/1 values to a function that created a new character that could be used with qx.spr
or qx.printChar
. Or, I guess when you load the chr.png
, you render it to a canvas - then a function could overwrite any character in that canvas with your own based on the pixel data you pass.
I guess you'd have to run regenColors()
each time they did this, so it would need some additional code to handle the tempCanvas
and this.chrImages_
that textrenderer creates, or it would just keep creating them for every custom character. Even so, it would allow for custom sprites without the need to edit the png, which I think makes sharing games much more accessible :)
Anyway, just a suggestion!
Hello, thank you for this awesome library, I really like it.
I've used it in a demo a few weeks ago (source code)
Basically, I built a toy voting machine with an Arduino connected to the Internet.
Then I showed the results of the votes in a boxing-match-like game. The fight was JS vs TS ๐
The game had to be displayed in a specific component in an Electron app. For this reason, instead of appending the canvas to the document.body
, I needed to append it to a specific element in the DOM, so I patched my local version of the library to achieve this.
But if you think this feature can be interesting for other people, I can create a PR in the next few days.
My idea was to add an entry in the config file, like:
export const CONFIG = {
CONTAINER_ID = 'my-container',
[...]
and then update internal/main.js
like this:
const containerId = CONFIG.CONTAINER_ID
const container = document.getElementById(containerId) || document.body
container.appendChild(realCanvas);
What do you think?
Would there be a way to make the method qxa.readLine() show the typed text over several lines instead of overflowing on the screen?
My initial thought was that the maxLen parameter would do something like that, but it seems to do nothing when used.
It'd be nice if we could give an ID or an element itself to the initializer to tell it where to render the canvas, instead of just creating and appending a new canvas to the body
qx.cursor(true) in theory should show a blinking cursor, but this doesn't work if the 3D screen effect is on.
I see you are using THREEJS for the CRT filter. If that is the case using a css filter will save you lots of space, or I can make a WebGL wrapper that only executes that shader without any THREEJS code. Let me know if you are interested.
So I noticed that if you call qx.playSound
multiple times in a row on the same sound on Safari, the sound can end up breaking and either playing only a very tiny portion of the sound or no sound at all
A way that I found to fix this was to update qx.playSound
to use cloneNode().play()
instead:
export function playSound(sfx, volume = 1, loop = false) {
qut.checkInstanceOf("sfx", sfx, HTMLAudioElement);
sfx.currentTime = 0;
sfx.volume = volume;
sfx.loop = loop;
sfx.cloneNode().play();
}
But I know this isn't ideal due to potential memory use, but so far it seems okay? I haven't noticed any performance at all using this method but I just wanted to create this issue here in case others have this problem too, and to maybe come up with a better solution
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.