getkey / ble Goto Github PK
View Code? Open in Web Editor NEWBombHopper.io's Level Editor
Home Page: https://editor.bombhopper.io
License: Apache License 2.0
BombHopper.io's Level Editor
Home Page: https://editor.bombhopper.io
License: Apache License 2.0
The current algorithm looks at all the segments and find the ones that have a point closest to the vertex you are trying to add.
But in some cases, 2 segments can fit these criteria, in which case, a segment gets randomly chosen. For a human, it would make more sense that the chosen segment be the one whose second point is closest.
More context: https://discordapp.com/channels/526188679006388254/601609930486841365/737049529869926482
(This issue is labeled as good first issue
because you don't need to know the codebase well to contribute, not because of the difficulty of implementing the algorithm 🙂)
When a parameter is common to all entities in the group, it should be possible to set it for all entities at once.
https://discord.com/channels/526188679006388254/644549821922803712/814024854906863666
As a continuation of #38
Ctrl
shortcut for adding to/removing from an existing selectionhttps://discord.com/channels/526188679006388254/644549821922803712/709806784063471717
Make selection dotted and moving, to help people with visual impairments (in particular for fire block where the selection isn't super obvious)
Seconds seem to be more intuitive than what we have currently: milliseconds (see https://discord.com/channels/526188679006388254/680197233337172092/785193162246586368 and the uploads above the Discord message).
For example:
Ball
s of radius = 0Block
s with points in the same placeRight now you have to put the ID.
https://discord.com/channels/526188679006388254/601609930486841365/810615233068269599
Context & original bug report: https://discord.com/channels/526188679006388254/601609930486841365/772917528170594304
Currently, pasted objects appear at the center of the screen. It would be nice if the top-left corner of their AABB could be aligned to the grid.
Using @ErikSom's trick of compressing JSON, then turning it into base64 so prefabs can be shared on Discord.
Let's use https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs as the format.
A good compression algorithm is necessary because Discord's character limit per message is presently 2000.
data:application/bombhopperio-prefab+json;compression=lz-string;base64,NobwRALgngDgpmAXJOAPCYA0YYEMBOuAtgM5LipIBMADDdlEgKy3YDGA9jI4uHAHZIwAFQAWASxIACSVIii4UgCZwAZrgCuAGwhStcAG5wtAQgA6/AKJLxuiBylQOG/HvEBrcfwDmYAL7YuPxsohz45GCUiDQAdEwMSLFMAWBB3vqJfgHg0PBC/GFEuFpYOATEZLxgRvgQ4mxwlaCRSAAsdAmIABy02S2I7fRgPF1dNH1RLEMjYxPMrMNIPeMAutiSAMoQuHVsSBD4GnBZmDmwCMj1CNh4hKQRNbuNSM1RALRUAGzTzLOn/R9vp1lnMBh1Ft1ev8ooNOgB2b6ggCMQIhCPG0KQHx+iE+7VBbyR7U6eNW6xIWx29X2h2OfVyFzAAiUMA4XgwN3K9yqkyYOM+AGYhpttrsaUdsPhxN5RBAAGK4NheXyIA4S1I+DLRE5nPLIGBaXBQODhTl3SoULGonifBZpLXCimi6mIdRaEhwbBFby4ABeXguwDA3nwAlwKlKcCIMGgpQARtp9BgVjrIOd8oViqVbhUHiank1LYgPgLPp0qABOKgEpEI8tVmt1iEClgEqilzot6trMAiql7V3FD1ZFZAA
How small can the entities in this level can turn out to be?
The comparisons below are done on base64 strings, close to real-world.
Some naive non-base64 benchmarks (because they all use the default paramters)
615 msgPacked.bin.br
638 msgPacked.bin.zopfli.deflate
644 msgPacked.bin.zopfli.zlib
652 msgPacked.bin.lzma
656 msgPacked.bin.zopfli.gzip
668 msgPacked.bin.lz
682 msgPacked.bin.bz2
690 msgPacked.bin.gz
700 msgPacked.bin.xz
721 msgPacked.bin.lzham
762 msgPacked.bin.zst
1018 msgPacked.bin.lzo
1035 msgPacked.bin.lz4
1065 msgPacked.bin.Z
2464 msgPacked.bin
TL;DR: the lzma module is sturdy and has a good ratio, so let's use that. (but let's make sure the service worker works since it's slow!)
The prefix will be as follow: data:application/vnd.bombhopperio-prefab+msgpack;compression=lzma;base64
Right now only vertices snap to the grid. Other entites such as doors and hoppis merely move by a multiple of grid.
More context: https://discordapp.com/channels/526188679006388254/526188679006388256/721467026589352047
While mobile zooming may have been added panning around in a zoomed in state is still impossible.
People often more naturally right-click than use shortcuts. Also, you can't use the shortcuts on mobile.
In the first version, it would have copy, cut and paste (more things can be added to it later).
It needs to be able to trigger with:
contextmenu
event on desktopSometimes levels can contain long numbers, probably because of floating point issues. It increases the size of levels while not adding any useful information.
{
"type": "deadly",
"params": {
"isStatic": true,
"vertices": [
{
"x": 300,
"y": -88.00000000000001
},
{
"x": 300,
"y": -89.00000000000001
},
{
"x": 290,
"y": -109.00000000000001
},
{
"x": 280,
"y": -89.00000000000001
},
{
"x": 270,
"y": -109.00000000000001
},
{
"x": 260,
"y": -89.00000000000001
},
{
"x": 250.00000000000003,
"y": -109.00000000000001
},
{
"x": 240.00000000000003,
"y": -89.00000000000001
}
It would be great if the levels could be optimized, either:
I'm not sure what's the best option for now, so tracking that here. I've added the functionality to BLT: getkey/bombhopperio-level-tools@e0134d8, which should be useful whatever the decision.
This parameter can flip vertically the texture of doors. The game supports it, it's used in some official levels (Choice on the top of my head). But the editor doesn't support the feature.
The interface takes up a lot of screen space on mobile. It should be hidden in a hamburger menu.
It's not intuitive at all.
More context: https://discord.com/channels/526188679006388254/526188679006388256/789505741194657803
How to reproduce:
add.ts:65 Uncaught Error: Trying to add a vertex but no entity is selected
at t._tapNext (add.ts:65)
at t._next (tap.js:45)
at t.next (Subscriber.js:53)
at t._next (filter.js:38)
at t.next (Subscriber.js:53)
at t.next (Subject.js:47)
at t._tapNext (control.js:11)
at t._next (tap.js:45)
at t.next (Subscriber.js:53)
at t.notifyNext (mergeMap.js:87)
An elegant fix for this would need mobxjs/mobx-state-tree#1540 to be merged, in the meantime, this issue is blocked 🙂
Instead of using the menu (suggested by flo_again#8602)
Removing a point isn't a big deal, no need to have a confirmation popup.
I might revisit this issue once #19 is done, as confirmation popups in general will become less useful (and still cause frictions) when there is a possibility to undo.
https://discord.com/channels/526188679006388254/681629693501243393/785361892281417758
Filter the events using event.target if possible. If not, use stopPropagation in the areas that shouldn't cause zooming.
More context: https://discordapp.com/channels/526188679006388254/601609930486841365/750084423218757664
Right now the editor allows you to set any digit as the star timing.
But actually it must be an integer in millisecond (or in seconds, have a maximum of 3 decimal places).
Currently, if you put for example 9.9999999999 as the number of seconds then try to save the level file, it will complain that the level is corrupted.
Lines 13 to 28 in 203fd61
On mobile, it is difficult to use the handles when zoomed out.
More context: https://discordapp.com/channels/526188679006388254/680197233337172092/735164809300934756
Support for having multiple entities selected.
Out of scope:
https://discord.com/channels/526188679006388254/644549821922803712/702588436015742977
https://discord.com/channels/526188679006388254/644549821922803712/709806784063471717
Right now, the editor is a standalone application. When it's loaded in the game, it's via an iframe, which is slow. If Blé was a library that could be directly used by the game, it could be cached more efficiently, and it would only be downloaded once per gaming session. Besides, common dependencies would be shared by the game and the editor.
import { Ble } from 'ble';
const ble = new Ble(document.getElementById('ble-app'));
ble.loadLevel(someLevel);
const currentLevel = ble.getCurrentLevel();
// later
ble.destroy();
Useful for:
More context: https://discord.com/channels/526188679006388254/644549821922803712/702588436015742977
Suggest adding some sort of formatted error message.
Context & original bug report: https://discord.com/channels/526188679006388254/601609930486841365/772917528170594304
Right now the cursor changes to the grabby hand, but when you click, nothing happens.
Suggestion <@211137158814105601>
The editor should warn you that if you unselect this polygon, it will be destroyed since it's invalid. But you will also be given the option to cancel to keep your invalid polygon selected so you can fix it.
Unselecting this polygon will remove it because it is invalid. Are you fine with that?
[Cancel] [OK]
More context: WMGX on Discord
Possible fixes:
https://discord.com/channels/526188679006388254/601609930486841365/805919281715740672
This will fix the grid snapping. That wasn't addressed in #21
Conceptually, this editor has 4 category of tools:
A bar on the top that goes accros the window. On the top left, the level name and the stars. On the top right, the meta-tools. On small screens, the meta-tools move below the level name and the stars
The edition tools are floating ~10px below that bar, on the left.
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.