beginners guide to using the accelerometer? - android

I am planning out a game that I will be writing for android, and the accelerometer is something that I am not familiar with. Getting the tilt, and creating a vector for the player is a very important part of the game. I've read the documentation and various tutorials. Doing so was a little confusing b/c none of what I read relates to game programming. So I have a couple of questions:
How do I get a vector from a onSensorChange event?
How do I change this vector in a way that looks natural as the tilt lessens/advances?

There is many examples and tutorials will help u.
Link 1
Link 2
sample project
Link 3
i sure some of this u see it before, but hope it help u.
and these two i'm sure will help u to understand what onSensorChange exactly do:-
What happens when onSensorChanged() in called
Good Answer

Related

There are still actual/supported andengine pixel collision on GLES2 Anchor Center?

I'm developing (trying at least) android-game and cannot find actual implementation of collisions between sprites for GLES2-Anchor-Center. No search results.
All implementations of Perfect Pixel Collision (m5 and MakersF on github for example) has a lot of errors, that cannot be resolved (maybe im just stupid). Anchor-Center even supported? Cannot post links for all of them, need more rep.
My issue for one of implementations example:
https://github.com/MakersF/CollisionTest/issues/1
Thanks for any help and sorry for my english.
There is no official pixel perfect extension to AndEngine. There is a lot of information how to make MakerF's extension work. It's bit of a reading explaining that the collision core has been separated into another project. For more information, see the forum post from here onwards.
It will take some effort, but it will help you understand how to collisions work :)

AI for the Dice game FARKLE

I'm hoping someone can point me in the right direction. I have a dice game called Farkle. The game is working great as a Two Player game. Now I want to implement an AI for a One Player game. Basically all I want it so if the current Dice score is >= lets say 300 to pass the dice back to the Human Player. There are a few other things I would like it to look for such as if all the dice have been used and all 6 dice can be rolled again.
I am new to the entire Java/Android world, so really don't know where to begin or look for any example for Dice AI examples. I have found a few for Poker, but I think they are way more complex then I need or for that matter can even understand. Any ideas?
BTW... I would be willing to send the source code for the Game to anyone that is willing and or able to help.
Thanks in advance!
To be honest I don't know any AI library that could help you. In addition I had to actually read the farkle rules to understand the concept and how AI could be integrated into that. So 2 options come into my mind that you however will have to implement yourself:
1.Use a neural network. The network will be trained using maybe backpropagation. As an error you could maybe use the difference of the 6 dices (that maybe be modelled by 6 different output neurons) sum from 300. If you search a bit I don't believe you will find it difficult to find a java library or source code examples.
2.Use genetic algorithms. For this actually there is a quite nice library JGAP. The chromosomes will be the result of rolling all 6 dice and the fitness function would be their score.
Of course both of the routes mentioned above are pretty generic and may not be very accurate. I am afraid that you will have to get familiar with certain AI concepts/algorithms. The farkle game is not that popular to have an AI package itself (like chess for example), so I believe you will have to implement things on your own (maybe using some libraries). Hope this helps.

3D waving flag in Android (using cloth simulation)

My goal is to create a waving flag in Android using OpenGL but I don't have any clue on where to start.
Cloth modeling seems to make the neatest effect but I couldn't find any implementation for Android on the web.
I hope that someone would know some tutorials, resources etc. that could help me solve this problem.
If you know easier/other ways to create a decent looking waving flag, let me know. I'm open for everything.
Thanks in advance!
First result on google
http://code.google.com/p/waving-flag-android/
A good tutorial about cloth simulation is from Jesper Mosegaard http://cg.alexandra.dk/2009/06/02/mosegaards-cloth-simulation-coding-tutorial/
The pioneer work on cloth simulation is from Darwin 3D http://www.darwin3d.com/gdm1999.htm#gdm0599
A open source project in Google Code provides a variety of algorithms http://code.google.com/p/opencloth/
All these works are based on C/C++ which is the natural programming language for OpenGL. As you are working on an Android project, you have to rewrite the algorithms in Java. After you figure out the mechanism, you should be fine. Good luck!

Page Curl Animation on Android with OpenGL-ES

I want to achieve a nice 3D page curl animation in Android. I read some articles and found that nice effect can be achieved by OpenGL-ES so I started to learn OpenGL-ES (I did some of tutorials of OpenGL-ES and am still continuing) but I found it too complex for me to achieve this functionality. Also I got some examples which are available on StackOverflow and on the net, they work but I am not able to understand it, can someone guide me to achieve this functionality?
Based on the question comments I have an answer to this question.
YES, you can do that with OpenGL, BUT you need a deep understanding of math and graphics. This is a lot to learn, this will cost you at least a couple of weeks and it's definitely a hard path to go if you do it only because of this single animation (all of this applies if you don't take code which you probably won't understand and another human being put his whole effort into).
Nevertheless there might a ready to use implementation but unfortunately I can't present you one because I don't know if there's any out there.
Update
You callenged me, so I was eger to know whether there is something out there (because I saw that before and couldn't believe that there isn't a project out there which already does that for you).
And actually I found this question which seems to address the very same issue. And yes, there's someone who published his results here. And I have to admit: I looks awesome. It's also a pure java implementation.
But still: Having some background knowledge about OpenGL would enhance your whole attitude as developer. I'm not saying it's a must because not every one will succeed in OpenGL programming because it's quite hard to learn and implies a lot of math. But I think it's worth it because you will gain some deep understanding of current and all future graphical interfaces.

Best way to create a trend/graph in my application

I have currently some values in an array that I would like to display in a trend / graph ( don't know the appropriate english word)
I have been looking in Android source code to find the Gingerbread battery graph (https://android.googlesource.com/platform/packages/apps/Settings/+/gingerbread-release/src/com/android/settings/fuelgauge/BatteryHistoryChart.java
)
That solution seem to be a little bit overcomplicated and too much for a simple and nice graph.
Can someone point me a tutorial / code sample?
Try AChartEngine, it's really easy to understand and set up. Comes with plenty of examples too. http://www.achartengine.org/

Categories

Resources