Tag Info

New answers tagged

1

Your issue comes from the fact that your 'hex' canvas is hidden by your 'ground' canvas, and do not receive the mouse events. But in fact you don't care from which canvas the click event was raised : just have your mouse handling code hook the events of the top-most canvas, and use those coordinates. (I assume here that all canvases have the same size ...


0

found answer: #canvas_ground { left: 201px; pointer-events: none; <<--------- this helps position: absolute; top: 31px; z-index: 1; }


0

The problem is that you are using a fixed duration for each reel even though each reel has a different y offset. Instead, you should calculate the difference between the current y offset of each reel and the y position 808. Using this difference, you can determine how long each reel should tween if each reel went a fixed speed. var diff = 808 - bmp.y; var ...


1

I know this is gamedev not game playing, but the Kerbal Space Program wiki has all the math and then some. More importantly, it explains it quite nicely in "plain English" if you drill down. Here's the basic mathematics of how to get something into orbit: http://wiki.kerbalspaceprogram.com/wiki/Tutorial:_Basic_Orbiting_(Math) I apologize for not copying ...


0

Try to remake your game in libgdx. Libgdx is fast enough and doesnt have issues like that and it works on all platforms. Unfortunately this is only what I can think of right now and I dont like the idea of converting js to android java or whatever that coverter does. Although it will take some time, give LibGDX a test.


0

Saw this the other day, might well be worth a look to solve this problem. Sounds like a pretty nice idea to me: http://tmtg.net/glesjs/ The fact that it works fine when in browser, but not when on Phonegap/Cordova is very strange indeed. The whole canvas/webGL situation on Android (can't speak for iOS) has always seemed pretty dire to me. Definitely ...


0

Every object should contain its own draw function which should be called by the game update code or draw code . Like class X { public void Draw( ) { // Do something } } class Y { public void Draw( ) { // Do Something } } class Game { X objX; Y objY; @Override public void OnDraw( ) { objX.Draw( ); objY.Draw( ); ...


0

I didn't read your code but I think what you're looking for is something like this: var currentZoom, //The zoom % circleCenterX, circleCenterY, // The circles center for viewing dotX, dotY // The dots center for vieweing function zoomInOrOut(delta) // To zoom out use a negative value { if (delta < 0 && currentZoom <= 1.0) return; // ...


1

while zooming out, check if distance of red-dot and center of circle is more than circle's radius. (Lets call this distance, d) if so happened, move the circle in direction of V vector ( V = red-dot.position - circle.position`) for x unit. (x= d-circle's radius).


0

If the aspect ratio remains constant, just scale the bitmaps. GUI elements might need some different handling though. For a more robust approach: Do your research into what resolutions are available for your target platforms and pick the most often used ones Create GUI configurations (ideally, purely visual rather than making more objects visible, etc) for ...



Top 50 recent answers are included