It is way to slow and in the first example it doesnt even move. How do
I make a game? With SurfaceView or OpenGL? And should I draw in a
separate thread?
package com.android.WWS;
import android.app.Activity;
import android.content.Context;
import android.graphics.*;
import
The green plane is shown on the golden-brown surface but when I press
a key nothing happens.
I want eventually be able to move the plane pressing 4 different keys
+ another one for shooting but that's easy if I can just get the thing
moving in the first place.
When I press a key in the emulator,
package com.android.shmup;
import android.app.Activity;
import android.content.Context;
import android.graphics.*;
import android.os.Bundle;
import android.view.View;
import android.view.KeyEvent;
import android.view.View.OnKeyListener;
public class Shmup extends Activity { //GraphicsActivity {
added setFocusable(true); but still doesn't work.
package com.android.shmup;
import android.app.Activity;
import android.content.Context;
import android.graphics.*;
import android.os.Bundle;
import android.view.View;
import android.view.KeyEvent;
import android.view.View.OnKeyListener;
public
I have done a simple game where I draw on a View and use invalidate()
to force onDraw to be called.
This however doesn't seem to scale at all since even for this little
game it is quite slow.
So what is the solution, to use openGL? that is what all games should?
and then I should use frames
I had it working with a normal View but that is to slow. I was told to
use SurfaceView but can't figure out how to use OnKey with it and if I
should use onDraw or draw?
And how do I pass stuff to draw? does it happen automatically?
package com.android.WWS;
import android.app.Activity;
import
Problems with using SurfaceView, I don't understand how to draw to it.
It has to be done manually? How?
package com.android.WWS;
import android.app.Activity;
import android.content.Context;
import android.graphics.*;
import android.os.Bundle;
import android.view.SurfaceView;
import
This just makes the screen black, why? I don't understand how to force
the draw of the SurfaceView.
package com.android.WWS;
import android.app.Activity;
import android.content.Context;
import android.graphics.*;
import android.os.Bundle;
import android.view.SurfaceView;
import
Thanks, that works. However it doesn't redraw when I press the keypad.
Why not?
This is what I have now:
package com.android.WWS;
import android.app.Activity;
import android.content.Context;
import android.graphics.*;
import android.os.Bundle;
import android.view.SurfaceView;
import
Thanks now it works. however the reason I use SurfaceView was because
I tried with View first but it is way to slow.
Problem is, it still is. The redrawing just isn't anywhere fast enough
for a game. So unless it is a lot faster on the real phone this won't
cut it at all.
Is it necessary to use
I use SurfaceView for my game, tried normal View first but that was to
slow.
Problem is, it still is. The redrawing just isn't anywhere fast enough
for a game. So unless it is a lot faster on the real phone this won't
cut it at all.
Is it necessary to use OpenGL for games?
package
no, thanks for the tip. should I have one main thread and then have
one drawing-thread running the whole time then?
and GameView should implement Runnable? what should be in run()?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
I want to do the drawing in another thread to speed up the game(it is
way to slow right now). I was told to do this but don't quite
understand why that would speed things up.
Is it GameView that should implement Runnable?
Should I make the thread sleep when not drawing?
where should I start the
13 matches
Mail list logo