GithubHelp home page GithubHelp logo

admenri / rguplayer Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 6.0 82.35 MB

The Ruby Game Universal (RGU) Project

License: BSD 3-Clause "New" or "Revised" License

CMake 1.23% C++ 65.58% Python 0.34% C 17.23% GLSL 0.65% Java 14.97%
gameengine2d gles2 rgss runtime

rguplayer's People

Contributors

admenri avatar

Stargazers

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

Watchers

 avatar

rguplayer's Issues

[Feature] Geometry API Extension

After reviewing common extensions to the Bitmap class, it's evident that shapes such as lines, circles, triangles, polygons, isogons, and ellipses are frequently added. As RGU already includes a Geometry class, extending it to handle common geometry shapes beyond just triangles seems beneficial.

  • Line
  • Circle
  • Polygon
  • Isogon
  • Ellipse

Build Instructions

It's better to add a few, otherwise people won't know how to build it, a workflow to build it is also an option

[Feature] Shaders

RGD has this cool thing where you can apply shaders to Graphic/Sprites/Viewports, it would be really cool to see something like that here

Reference from other functional RGSS implementations

Angle on Linux

It appears that it is unable to detect the .so related to Angle (tested putting it in ANGLE/amd64, ANGLE/i32 and in the root folder), i was trying to test running Angle with Vulkan on Linux

[Feature] Graphics API Extension

Properties

  • Graphics.fullscreen

    • Check if it is in fullscreen with Graphics.fullscreen and toggle it to true or false with Graphics.fullscreen=.
  • Graphics.scale

    • Scaling feature allowing users to adjust the game window/screen size dynamically with Graphics.scale= such as scaling it by 2x or 0.5x.
  • Graphics.vsync

    • Toogle it to true or false with Graphics.vsync=.

Methods

  • Graphics.capture_screen

    • Capture in-game screenshots, enabling sharing of memorable moments or troubleshooting assistance through visual representation.
  • Graphics.delta_time

    • Graphics.delta_time is exceptionally useful for modifying your game to stop synchronizing with the frame rate, ensuring consistent gameplay regardless of variations in frame rate.
  • Graphics.shader

    • Applying global shaders that will affect all Viewports/Sprites such as xBRZ, scalefx, GameBoy Color...

Sprite Drawing Benchmark

As it is still in development, it may help you, LiteRGSS2 seems to be the fastest of the bunch for now

Engine Sprites Frames per Second
MKXP-Z 20,000 34
RGM 50,000 33
LiteRGSS2 50,000 47
class SpriteGenerator
  DEFAULT_SPRITE_COUNT = 20_000
  SCREEN_WIDTH = 640
  SCREEN_HEIGHT = 480
  SPRITE_SIZE = 32

  def initialize
    @sprite_count = DEFAULT_SPRITE_COUNT
    @viewport = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)
    @bitmap = nil
  end

  def run
    initialize_sprites
    loop do
      Graphics.update
    end
  rescue StandardError
    puts "\nEND\n"
  end

  private

  def initialize_sprites
    puts "Sprite Count: #{@sprite_count}"

    @sprites = @sprite_count.times.map do |i|
      initialize_bitmap if (i % 100).zero?
      initialize_sprite
    end
  end

  def initialize_bitmap
    @bitmap = Bitmap.new(320, 320)
    @bitmap.fill_rect(0, 0, 320, 320, random_color)
  end

  def initialize_sprite
    sprite = Sprite.new(@viewport)
    sprite.bitmap = @bitmap
    sprite.x = rand(SCREEN_WIDTH) - SPRITE_SIZE
    sprite.y = rand(SCREEN_HEIGHT) - SPRITE_SIZE
    set_sprite_src_rect(sprite)
    sprite
  end

  def set_sprite_src_rect(sprite)
    j = @sprite_count % 100
    sprite.src_rect.set(32 * (j / 10), 32 * (j % 10), SPRITE_SIZE, SPRITE_SIZE)
  end

  def random_color
    Color.new(rand(256), rand(256), rand(256), 32)
  end
end

SpriteGenerator.new.run

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.