era-dorta / gosu-android Goto Github PK
View Code? Open in Web Editor NEWA Gosu implementation for Android devices, undergraduate project
License: MIT License
A Gosu implementation for Android devices, undergraduate project
License: MIT License
Touch events (touch_began etc) report X and Y values relative to the SurfaceView size instead of the Gosu::Window size.
This was reproduced when creating a Gosu::Window with 320x240 size in landscape mode on an HTC, where I could get X values > 1000 (as I can move the touch outside the screen into soft-button area).
From logs:
I/System.out( 649): MainGameWindow - 320, 240
I/System.out( 649): SurfaceView: 960, 540
I/System.out( 649): [GameScreen] draw... @ (1063, 531)
Hi,
It's me again. I'm interested in maintaining/extending this project in the very short term (like 1-3 weeks) to get one of my proof-of-concepts done. I will submit PRs for things I change.
For now, I need help. When I define touch_ended
events in my GameWindow
class, they're never called. I don't know why.
I looked through the code, and it seems fine. The handlers are defined equally for all three touch_*
methods. I can't see where the problem is.
I'm using the v0.0.5
gem, if that matters.
Hi,
I noticed two distinct differences between Gosu and android-gosu.
MainWindow.initialize
, gosu freezes with the game not loaded or displaying anything, while gosu-android starts the game and the sound loads later.draw
or update
I call sound.play
(I know, I know, it's crazy), gosu waits until the sound finishes before restarting it (normal looping). gosu-android stops and restarts, so it sounds like the first fractional second of the sound is stuck.The first issue is not really a problem (where's my Ruboto loading screen?!), but I would like to resolve the second issue. I'll take a look at the code tonight if I can, and see if it's easy to do so. Please confirm if that change is okay with you :)
@neochuky
Hi,
I just installed gosu today via Ruby 1.9.3 (gem install ...
) on Windows. I have confirmed that:
However, I can't get a working combination of the two. When I generate a new ruboto sample app and just add require 'gosu'
, I get this exception at runtime:
FATAL EXCEPTION: Thread-11 org.jruby.embed.EvalFailedException: (SystemStackError) stack level too deep .. at RUBY.JavaImports(file:/data/app/com.blastcube-1.apk!/lib/requires.rb:7
Full exception is pictured below. I followed the deployment instructions from the trunk branch
Screenshot below of logcat on Bluestacks.
At least lib/Input/buttons.rb uses constants that were introduced with Android 4.0.3.
Hi!
This looks great! I tried the arkanoid example with Ruboto master, and it works perfectly except that I get an exception when trying to play the background song:
E/MediaPlayer(16127): Unable to to create media player
I/System.out(16127): initialize failed: setDataSourceFD failed.: status=0x80000000
I/System.out(16127): android.media.MediaPlayer.setDataSource(Native Method)
I/System.out(16127): android.media.MediaPlayer.setDataSource(MediaPlayer.java:1225)
Is this a known issue?
The beep plays fine.
Hi,
I've been dabbling with gosu_android for a while. I'm planning on making a cross-platform (Windows + Android) app with Gosu + Gosu Android.
In the past, I could use require 'gosu'
, and it would work across platforms. Now, I need:
if RUBY_PLATFORM =~ /java/
require 'gosu_android'
else
require 'gosu'
end
I protest! I'm sure you changed this for a very good reason; what was it, and would you consider reverting this back to the old behaviour?
Hi,
I seem to have encountered a strange bug. When printing out the coordinates on touch_moved
, it seems like (on Genymotion, at least) the coordinates are offset by some pre-determined amount.
When I click/move in an area around the top-left corner of the screen, I get x=0, y = 56.476
(approximately), consistently.
It could be an emulator-specific bug. I don't have a device handy to test on. I know Bluestacks had its own strange bugs in the past.
This is a great programmable tank game. Would be fun to play it on Android. Cool features would be to program the tank directly on the device, upload tank definitions to a server, and enable tournaments with other people's tanks.
I have a simple game that draws an image on screen.
class GameWindow < Gosu::Window
def initialize
@done = true
super 640, 480, false
self.caption = "Gosu Tutorial Game"
@background_image = Gosu::Image.new(self, Ruboto::R::drawable::background, true)
@x = @y = 0
end
def draw
puts "Coordinates are #{@x}, #{@y}; done is #{@done}"
raise "LOL WUT" if @background_mage.nil?
@background_image.draw(@x, @y, 0)
end
end
I get a black screen. logcat gives me this interesting result:
Coordinates are , ; done is true
LOL WUT (RuntimeError LOL WUT ["..."]
In other words, @done
persists, while @x
, @y
, and @background_image
become nil. It's strange. If I add a .nil?
check/throw after assigning a value to @background_image
, it passes; so it seems like the image gets created, very temporarily, and then it vanishes.
This is the same on both BlueStacks and my Galaxy Discover.
This is to ensure that gosu-android works with different Android versions, at least api levels 10,15, and 16. It also protects against regressions for the tested features.
Ruboto is already being tested on travis-ci, so you can copy the setup from there.
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.