I am trying to learn game programming using AndEngine. I have created animated sprites that are spawned on different intervals. I would like them to shoot objects at my player. I have searched trying to learn how others have done this, and tried the code that i thought would get me started, but have been unsucessful. Can someone pleae point me in the right direction to accomplish attaching a child sprite and having it shoot at different intervals in AndEngine.
thanks in advance!
You don't need to attach bullets as child, here is the very good tutorial and it's shooting bullets :), You're in luck!
Related
I am completely new to android game programming. I really dont have any idea how can we create animated sprites. I have seen this guy using that amazing application RUBE to create a game character http://www.youtube.com/watch?v=bBIXpu-D_Zo can we do that stuff in android too ?
Even if we can how can we load such massing character to our andorid project. I accept i am noob at this but i have great interest in game development, please help me with detailed answer.
Thanks in advance
What you'll need is a sprite sheet. A series of images on the same bitmap laid out in a grid. For example you would have 8 different sprites of the same character, 1 standing still., 1 left foot forward, 1 right foot forward and jumping and again facing the opposite direction.
When you draw the sprite set the coordinates to be drawn and on button presses change the variables controlling the coordinates.
A good tutorial is here http://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/
and a sprite sheet maker can be found here http://www.codeandweb.com/sprite-sheet-maker
Hope this helps!
I have created a character and I wonder how I have to animate it regarding the fact that :
It has to move when on static position, I mean for example eyes blinking, mouth closing.
It has to move on the screen regarding to player gesture.
It has to be involved in collision.
I read about, AnimationDrawable, SurfaceView, Canvas ... but which way is the best ?
Thank very much !!!
If you're trying to make a game you should consider GLSurfaceView with textures.
This is a pretty good tutorial, though it contains a few coding errors, it makes the concept very clear!
The OpenGLES method would give much much more freedom, than animating Views, but maybe harder to master.
1) I am developing an android application for a puzzle that will involve n*n matrix displayed to the user. There will be objects(images) in each of these cells. Whenever the user clicks on the any cell the object of that cell should exchange position with one of the valid nearby cells.
2) When the object exchanges position, the movement should be shown to the user - the image slowly moving from its original place to another place.
If the animation above is very difficult to implement, please leave it. But I would like to know the answer for the question 1). Which layout would be the best for such a puzzle, which will involve constant re positioning of the child elements(cells).
If it's game - SurfaceView is your way. It's good idea, because you can draw from different threads and it's comfortable. If you want to create not simple game, use engine as example AndEngine. So you can use GLSurfaceView - openGL is very fast but it's not simple. And last way use simple view, but my opinion - it can be game like XO, barley-break and other not fast simple game.
upd:
If I create this game as in your case, I will use SurfaceView w/o any layouts. But I think you can do it with help standart view w/o surface. If your question about layout, I think its not matter. For example GridLayout. As minimum it sounds logical.
Good luck!
You would have a greater control if you create a custom view using the View or the SurfaceView.
I am working on a similar n*n matrix game and I am using the AndEngine game engine. It allows me to load images and then place them in an n*n grid.
I'm trying to create a simple Pegs game. I have drawn the 15-hole board using canvas. I have been programming a while, but games are new to me and I'm stuck on what to do when it comes to handling the pegs. I want to only use the touch screen, but it seems like it is really difficult to touch the pegs and actually select them individually. I plan on just drawing everything programmatically. What is best way on handling this? Using buttons as place holders and changing the button image? Any help would be greatly appreciated.
To be very brief, you have to keep track of the things you draw on the canvas.
I wrote some tutorials for making and moving selectable shapes on the canvas. They should help a lot.
On android it might be a little different than using mousedown, but it should give you a very good starting place.
I don't know if this will help, but you might want to write your own onTouch()function. Check it out
ok to clarify. i understand that the map data is basically some images grouped in bounding boxes and drawn on a 2d canvas. is it possible to rotate the whole view so that it looks like on the image i posted from google earth, to get a kind of fly-over look? i know that there is a class in adroid used for 3d rotations on images(the camera class Graphics.camera)
There was a nice tutorial not long ago from sony-erricson with their 3d listview describing its functionality, but i don't think i can achieve what i need with it. is there a way that a view can be rendered maybe on a GL surface?
i realize that this isn't that simple to do but any suggestions or ideas on the matter can be helpful.
so where do i start?
tnx.
Very straightforward with OpenGL. Use triangles laid out in a huge grid and texture map accordingly, setup a camera and you are done. You even get elevations etc right with heightmapped terrain.