Giter VIP home page Giter VIP logo

leikr's Introduction

I try to make games. I try to help on Fedora Linux.

leikr's People

Contributors

pixelbath avatar torbuntu avatar ulhar 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

Watchers

 avatar  avatar

leikr's Issues

[Tool] Workspace locator, File Manager command

It would be handy to have a terminal command to either display the running Workspace directory so users can find it, or better yet to even open the workspace in the Host file manager program.

Unable to load anything other than PNGs with `drawTexture()`

Describe the bug
When I specify the file extension for a texture, Leikr automatically appends .png to the filename. If I use a jpeg or add .png to the texture filename myself, it is still appended with .png.

To Reproduce
Steps to reproduce the behavior:

  1. Load any asset from the Art folder as a texture, specifying file extension
  2. File is not loaded unless it's a) a PNG, and b) the extension is not added in code

Expected behavior
If I enter a file extension, Leikr should load that regardless of type (provided it's a supported image type). If extensionless behavior is desired, Leikr should default to PNG and appending the extension only when the extension is not specified.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 0.0.16

Additional context
Add any other context about the problem here.

[API] drawRect() not aligned to pixel grid

When using the built-in drawRect(), I get this:
image

I would expect it to look like this:
image

This is most likely due to pixel boundary alignment on line segment endpoints. This might be another case for replacing the built-in draw calls.

Here is the code implementing pixel-perfect rectangles in Groovy:

    void drawPixelRect(int x, int y, int width, int height, int color) {
        for (def i in x..x+width) {
            drawPixel(color, i, y)
            drawPixel(color, i, y+height)
        }
        for (def i in y..y+height) {
            drawPixel(color, x, i)
            drawPixel(color, x+width, i)
        }
    }

[GameShell] Can't find OpenAL

Describe the bug
On the GameShell audio is unable to work due to missing OpenAL.

To Reproduce
Launch Leikr on GameShell from ssh to view logs

  1. ssh into GameShell and navigate to Leikr directory
  2. export DISPLAY=:0
  3. ./Leikr
  4. View openal error exception

Expected behavior
Audio initializes and no error.

Desktop (please complete the following information):

  • OS: Clockwork OS 0.5, GameShell

Additional context
This may be a simple fix by finding a way to download/install OpenAl on the GameShell, if it doesn't have it already. I know on the Raspberry Pi I have to do this as well for audio to work.

[Bug] Mouse "cursor" visible at all times

Describe the bug
I get a 2px wide "cursor" placed approximately at my mouse's position. I say "approximately" because it seems to be offset a couple pixels in the positive x and y directions.

To Reproduce
Steps to reproduce the behavior:

  1. Open Leikr
  2. Use the following code:
class CursorDemo extends leikr.Engine {
    void render() {
        bgColor(1)
    }
}
  1. Move mouse over Leikr window
  2. Observe black "cursor" following the mouse around

Expected behavior
Mouse position would not be visible unless explicitly tying something to mouseX() and mouseY().

Screenshots
leikr-cursor-pixels2

Desktop (please complete the following information):

  • OS: Windows 10
  • N/A
  • 0.0.15

.lkr packages from windows don't install properly on Linux

Describe the bug
When running install [package-name] on Linux with a lkr package exported from Windows the project loses all directory data, and the paths are just the names.
Example, instead of a directory Code/Game.groovy the name itself is Code\Game.groovy

To Reproduce

  1. Obtain or export a project on Windows
  2. On Linux with the lkr package in the Packages directory, try running install [package-name]
  3. Project will not be able to run. Directories missing.

Expected behavior
All Leikr packages should be exportable and installable from any supported host operating systems. Linux to Windows and back.

Desktop (please complete the following information):

  • OS: Windows, Fedora Linux
  • Version: 0.0.16+

Additional context
File paths should not be affected by the zip process like this. Zipped directories should be "universal".

[API] drawPixel inconsistent

The drawPixel function takes an index as a color argument, but many of the other methods take a color via setColor which allows for RGB strings of arbitrary values, and some (drawString) take either indexed or RGB string and do not use the setColor method.

Solution: Either add more overrides to other drawing methods, or use setColor() for all color input.

[Lib Bug] Controller directions not registering

While testing controller input, I was unable to read anything from the directions. I am using:

if (button("UP"), 0) {
    // do stuff
}

And this is the result. All controller buttons are read correctly except directions. I am using an Xbox 360 controller and moving both the analog stick and d-pad:
leikr-controller-input

`ProgramName` not immediately available after `new ProgramName`

Describe the bug
When initializing a new program with new ProgramName, then ProgramName is not available in the run list without running ls.

To Reproduce
Steps to reproduce the behavior:

  1. Initialize with new ProgramName
  2. Use up/down to select programs, observe that ProgramName is not in the list.
  3. Run ls
  4. Program now appears

Expected behavior
Leikr should know about my program as soon as it creates the folder, since it is doing so internally. I understand the triviality of this request.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Make `getPixel()` return RGB

Is your feature request related to a problem? Please describe.
getPixel() returns an indexed color. While that's nice, it doesn't let me do more advanced sampling-based pixel manipulation.

Describe the solution you'd like
getPixel() should return an RGB string, or an object with discrete R, G, and B values.

Describe alternatives you've considered
getPixel() could also return the closest color to the sampled value, but restricting getPixel() where other methods are not restricted is inconsistent.

Using an out-of-bounds sprite index gives generic error

Describe the bug
When selecting a sprite index that does not exist (possibly because I used the wrong sprite size), Leikr gives the very general error: Error in program 'render' method. null

To Reproduce
Steps to reproduce the behavior:

  1. Call sprite() with an invalid index id (try sprite(32, 0, 0, 1))
  2. See message.

Expected behavior
A clearer error message, something like "Sprite index out of bounds"

Screenshots
image

Remove/change Mini2Dx logo from startup

While I'm sure they appreciate the free press, the wiki and readme have this information spelled out. I think it breaks the "console" immersion a bit if the startup of the system shows a graphic that's not the same resolution.

Solution: Either drop the Mini2Dx logo, or alter it to be in-line with Leikr's graphics specifications (more pixelated and conforming to the palette).

[Feature] Add wiki command

In the terminal view there should be a wiki command (with option parameter for page) which will open the host browser and navigate to the Leikr wiki.

Program icons

If possible, the finished .jar file should use the Leikr logo. Likewise, the executing program should have a matching icon.

image

Leikr not reading program folder dynamically

If I say load ProgramName in Leikr, and that program was created while Leikr is running, that program is not usable until I restart Leikr and I get the error message "Program [ProgramName] does not exist in Programs directory"

Conversely, I do not need to load a program to have it updated after editing; I can simply exit the program and call run over and over to see changes. The program does not seem to be held in memory separate from disk.

Gif export does not match actual framerate

Describe the bug
When exporting a gif, the gif's framerate does not actually match the display framerate. This may be a desirable effect in certain scenarios, however.

To Reproduce
Steps to reproduce the behavior:

  1. Make something that drops the framerate in Leikr
  2. Capture a gif while displaying the framerate
  3. Playback exported gif, see framerate is butter-smooth

Expected behavior
I'm not sure if this is actually a bug, but maybe a toggle to capture actual vs. "smooth" framerate

Screenshots
Uploading recording1579222900.gif…

  • Version - Latest

Allow leikr programs to use arguments from the command line

Is your feature request related to a problem? Please describe.
Some programs would benefit from the user being able to send information from the in-leikr terminal. (IE, the user could change certain constants in a simulation from the terminal)

Describe the solution you'd like
create ought to take a string array parameter consisting of every (whitespace delimited) command line argument. This is the way it is done on a lot of systems and in a lot of languages (C and Java come to mind) so it will be a very familiar solution to most programmers. This way if I run example hello then leikr programs will be empowered to know the user sent hello as the first command line argument

New program uses default value for class name

When creating a program with the new console command, using ProgramName should result in:

class ProgramName extends leikr.Engine {

    void create(){
        
    }
    void update(float delta){
        
    }
    void render(){	

    }
}

Instead, NewProgram is still the default:

class NewProgram extends leikr.Engine {

    void create(){
        
    }
    void update(float delta){
        
    }
    void render(){	

    }
}

Changing the class to the actual program name should reduce new program friction.

[GameShell] Leikr blank screen when exiting program

After pausing and confirming to exit to terminal, Leikr will drop to a blank screen on GameShell.

In the terminal there is notice some missing native lib linkage for Jamepad pointing to Raspberry Pi CPU specific libs.

This may require building directly on the GameShell.

[Core] Screen scale factor

It would be nice to specify the scaling factor of the Leikr screen. The default currently seems to be 2 (double size pixels), but I'd like to specify no scaling or even higher if possible.

Seems like system.properties would be a good place for this.

image

Screen recording

Would it be possible to get a screen recorder, either to .mp4 or .gif? I currently capture the window with third-party software to show off my Leikr programs, but it would be great to have a simple hotkey.

[Feature] Add terminal 'about' command for programs

The current program.properties files don't do anything with a lot of the detail information (such as about, players, author etc...)

It would make sense to have a terminal command 'about [game]' that displays that information. This way folks can read the description info before running a game.

getPixel()

Can we get a getPixel(x,y) method? Framebuffer tricks work well when we can sample other pixels on-screen.

Calling `drawMap()` without `loadMap()` yields unspecific error

Describe the bug
When calling drawMap() without first having called loadMap, Leikr gives the error Error in program 'render' method: null.

To Reproduce
Steps to reproduce the behavior:

  1. Put a drawMap() call into the render() method of a new program
  2. Run it
  3. See error

Expected behavior
An error like drawMap: No map loaded. or something to indicate the call causing the error and the reason why.

Screen resizing hotkey

Is your feature request related to a problem? Please describe.
Though Leikr can scale to arbitrary sizes, I would like to switch between (or snap to) a different resolution that draws pixels at a fixed ratio, like 1:1, 2:1, the original 3:1, and so on.

Describe the solution you'd like
I would like a hotkey to switch between fixed pixel ratios. Perhaps something like Ctrl+1, Ctrl+2 for 1:1 and 2:1 aspect ratios, respectively. It is assumed that Leikr running on Raspberry Pi would be already fixed at 1:1.

Describe alternatives you've considered
I considered using extra buttons on gamepads to open a sort-of hypervisor screen to manage screen settings and other things for Leikr, but the specs are fixed on controllers already, and users using actual SNES-like pads will have no system-supported option. Besides, any console-like environment will likely already have its scaling ratio pre-set.

Additional context
Add any other context or screenshots about the feature request here.

Fix javadoc gh-pages generation

Is your feature request related to a problem? Please describe.
The current generator for javadocs leaves the javadoc pages under the URL:
https://torbuntu.github.io/Leikr/docs/index.html
but is not a big deal, but it leave some issues with how pages are set up.

Describe the solution you'd like
I'd like to have a clean gh-pages branch with only the documentation and site related pages on it. All the code should remain on the proper master branch.

I'd like everything in the gh-pages branch to be the documentation website, and everything under the master branch for regular project code.

[API] Parameter order consistency

The ordering and method of passing parameters of some methods are inconsistent with each other.

drawPixel()  - color, x, y
drawString() - text, x, y, color

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.