Code Monkey home page Code Monkey logo

qx82's People

Contributors

btco avatar son-link avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

qx82's Issues

Render canvas on provided container

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

readLine printed over several lines

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.

Define your own characters

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!

Issues rendering on first initial load in Firefox

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!
firefox_2p4YWfvvRL
firefox_aJcsKEtSQd

Possibility to append the canvas to a custom element

Hello, thank you for this awesome library, I really like it.

I've used it in a demo a few weeks ago (source code)

image

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?

Removing ThreeJS

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.