Android : Game Math / Logic Calulating Movement?

Aug 26, 2010

I know this is more of a general programming question, but my Android friends here have always been helpful. I am trying to make an image move from one part of the screen to a position the user touches, as a constant speed. I don't know the best way to go about doing this and the way I have been trying to get to work is taxing my brain too much.

I have been using geometry to calculate slope, then using Sin * movement speed to calculate the difference in X,Y coordinates.

This is the codecode...

The problem that I'm having is the image is veering way of course when traveling in Y heavy paths. When traveling horizontally it works almost perfect.

I know there is probably an easier way though I don't know how to use a lot of things (like OpenGLES) so if your advice is to use a different method please link a tutorial for that method if you know of one.

Android : Game math / logic calulating movement?


Games :: 1 Minute (Logic) Game For Android Market

Mar 7, 2010

I'd like to announce the release on the Android Market of our last creation: 1 Minute Game. The main concept is very simple. The computer shows puzzles based on numbers, shapes and colours: the player must solve them and touch the correct answer to go to the next round, trying to be as fast as possible. We implemented 3 different modes that must be unlocked by playing more and more. You can play games under the "Training" areas so to train yourself and challenge your friends locally (there are 6 slots to store the profiles of the players).

Online Challenge
But the core of 1 Minute Game is the online challenge, which allows the players (once per day) to play a special match and to send the result to an online leader board. Each score shows also the nationality selected by each player try to get your country at top of the ranking. The ranking is visible both through the application and visiting the web site of the game.

Free DLC
In order to make the game more appealing and let you enjoy it for more time, we are developing new games to be released for free in the next versions of the application. For example, this morning (it's a matter of minutes) we will release the version 1.1 which contains a brand new game in the training section: The intruder. In each round, all of the objects shown on the screen share the same characteristic (same shape, colour, number or animation) except for one: that's the Intruder!

New games of logic will be released once they are completed and fully tested through future news.

LITE version
There is also a LITE version in the Market: 1 Minute Game LITE (limited number of levels, no online challenge and 2 slots to store the users' profiles), so you can try it and see if it is worth to buy the Full one. This LITE version includes the additional training "The Intruder" as well.

DOWNLOAD
the game can be downloaded from the Android Market. Just search for its name or click on these links with the browser of your Android smartphone:
FULL version - market://search?q=pname:com.wepromite.oneminutegame
LITE version - market://search?q=pname:com.wepromite.oneminutegamelite

View 7 Replies View Related

Android :: Compensate Drawing Delay From Game Logic Updates

Aug 24, 2010

Now I have (1: the UI-loop, there my SurfaceView is placed), (2: a second thread, there the draw function from the UI-loop is called AND the update calculations from my Engine) and (3: the engine, there all the calculations stuff are).Now I wonder how the best and smoothest way to do the SurfaceView independent from the actual frame rate. How shall I do so it will compensate if there is a low frame rate?

View 2 Replies View Related

Android :: Making Game's Logic Supporting Multiple Screens

Jul 25, 2010

I've read the article "Supporting Multiple Screen" on Android developers site. But that doesn't apply to game logic.Let me get straight to the point. My situation is as follows:

- I'm creating a game using LunarLander code as a base.

- In my game, there'll be an object flying up from the bottom of the screen. The object will fly in projectile motion.

- I set the starting velocity, gravity and angle so that the highest point(of projectile motion) is almost at the top of the screen.

- The screen tested is Motorola Milestone. (480x854 resolution) Meaning the object travels around 854 pixels vertically.

I'm thinking of adjusting starting velocity based on screensizes. But that sounds unreliable when we've so many devices/resolutions out there. How do you combat these kind of problem when making games?

View 3 Replies View Related

Android :: Android OpenGL Game - App Architecture / Threading Logic

Apr 8, 2010

Surprisingly, I don't seem to have issues with the OpenGL side of things (which is very unusual), but my problems stem from getting a clear idea for app architecture and a few other problems. Right now, most tutorials on the net just describe the render portion. I know that when I create a GLSurfaceView and hook a Renderer into it, it uses it's own thread for rendering.

I want to do logic operations and other gameplay stuff (like moving characters and whatnot) in it's own thread as well. Can anyone explain a good approach to this? I'm guessing the two threads will have to be synchronized (do logic, render, repeat), and limited based on time so that it performs smoothly across different devices.

View 1 Replies View Related

Android : New App - Math Alarm Clock

Aug 6, 2009

Im the developer of a fairly new app the Math Alarm Clock. A month ago I looked for alarm clock which was a challenge to turn off and didnt find any on the market so I developed this. Basically you tell it how hard you want the math (4 levels of difficulty) from (5*8) to [(17*19)- 16*12)]. It is smart enough to never give you stupid easy questions such as (73-73) or (1*10). Then choose how many in a row you must answer correctly from 1 to 6 to turn off the alarm. Specify a few math-free snoozes if you like to snooze a few times before entering math. Or turn the math off completely and use it as a regular alarm.

The other unique feature is the music alarm. Of the other alarm clocks I found one required you to change music into a ringtone and the other only allowed you to pick one song. This alarm clock allows you to choose an individual song or choose a random song from a specific artist or a random song from a specific album.
And for any Canadian Rogers Dream or Magic users you may have noticed other alarm clocks will completely crash your phone and require a factory reset. This has been fixed in the Math Alarm Clock and it should work with no problem on HTC based phones.

Lastly as the comments point out, I respond to feedback very fast and for the most part have requested features implemented within 24 hours.

The last few comments:

"This developer rocks! I requested a feature and it was added within hours. This is the best alarm clock for the G1 hands down!" 5/5
"Great app, developer is quick to update. Highly recommend!" 5/5
"Awesome app!" 5/5
"Amazing! The only alarm that actually wakes me up" 5/5

View 5 Replies View Related

Android :: Math Floating Point Library

Jan 12, 2010

I need maths for my game physics and lots of them, so I use the. Math library. And guess what? I never casted so much to floats in my entire life. And i know how costly it is to use doubles on an embedded device because I read the performance optimization page in the google android sdk docs. So I am wondering if we couldn't get a Math package with functions taking and returning floats instead of the default doubles. e.g. Math.sinf Math.cosf.

View 3 Replies View Related

Android :: Faster Way Than Math.atan2 For Arc Tangents?

May 24, 2009

Using arc tangents for interpreting accelerometers seems to be a pretty easy way to go to get a desired result. I just benchmarked (float)Math.atan2(x,y) and it's a very slow function. I checked FloatMath for Android 1.0 SDK and it has sin and cos but no tan or atan. Is there a faster way to do this?

View 2 Replies View Related

Android :: Display Math Notation Like Square , Exponent In Textview?

Oct 17, 2010

I want to create a mobile learning for an high school. Is there a way to display math notation like square, exponent etc in textview? Or should we use another component?

View 3 Replies View Related

Android :: Any Listener For Shake Movement?

Mar 1, 2009

Is there any Listener able to listen for shake movement. when someone shakes the phone an event should be triggered ,how I'm supposed to do that ,any idea on this topic is appreciable.

View 12 Replies View Related

Android : Get Device's Movement Speed?

Apr 8, 2010

Imagine to have the device perpendicular to the table, in portrait. The Z axis is watching to you and the Y axis to the sky. I want to measure the device's movement speed when I rotate it on the X axis. How can i get it?

View 9 Replies View Related

Android :: Looking For Definitive Location Finding Logic

Mar 31, 2010

I am looking for a tutorial that explains the logic for fast, robust location finding.Basically I am sick of Google Maps finding my location so incredibly fast and accurately while my own application struggles to get a location.I would be fine with pseudo code responses and I will explain what I am doing so maybe I can be shown what I am doing wrong.

1. Get the locationManager object.

2. Do a 'get best provider' call.

3. Get a list of all available providers.

4. lm.requestLocationUpdates(bestProvider, 0, 0, this); hit the location provider as much as I can to get my first signal

5. Send a delayed message.If a location cannot be found in 10 seconds, switch to a different provider and try again with lm.requestLocationUpdates(nextProvider, 0, 0, this);

6. Repeat step 5 until I have a location.

7. Once a location is found determine if it is the most accurate provider.If it is not try again with the most accurate provider on an 8 second delay.If it is the most accurate provider then set lm.requestLocationUpdates(currentProvider, 30000, 0, this); to conserve battery

8. Make sure to lm.removeUpdates(this); before changing the requestLocationUpdates

Now it occurs to me that it may be possible to iterate through my list of providers and do requestLocationUpdates for all providers at once.Is this a viable option or can you only listen to one provider at a time?I have seen that location from onLocationChanged has getProvider()to let you know who provided the location information so that I can know which provider is actually finding a signal and turn off the others.

View 5 Replies View Related

Android :: Logic Different Between Using Keypad - With Finger Tapping?

Jun 19, 2009

I have a ListView. When I click a row Item (which are just TextView instances) I want them to remain hilighted (default orange color). The default behavior is that they flash orange.

Strangely, if I use the key pad (arrow up/down) to move between items, it has the exact behavior I want. Why is the logic different between using the keypad or with finger tapping?

View 7 Replies View Related

Android :: Controlling Movement Of Device Using Emulator

Nov 6, 2010

I am working on an application where i will track the movement of the android device inside a building... suppose i display a map of the building in the android emulator... Now,i need to simulate the movement of the android device.... is there a way in which i can control the movement of the android device and see the real time movement of the device in the map ... like a dot moving in the map .... Is this possible to do using the android emulator? when i googled this requirement, i came across SensorSimulator...But,this software shows the acceleration,magnetic field and temperature values... It doesnt display the co-ordinate values....

View 3 Replies View Related

Android : Get Body Movement (e.g. Turn Around) / Manage?

Dec 27, 2009

I'm working on an app that needs body movements as inputs. So basically I want to know if a person turns around completely (360). If a the person does sthg happens inside the application. My problem for now is: How to figure out if a person turned around? I don't see an approach with gps as the person is not moving enough. So I thought about the compass or acceleration sensor but I have no clue how to manage that.

View 6 Replies View Related

Android : Make MapView Navigation Movement?

Dec 27, 2009

I am trying to make mapView can be moved when navigation movement (when user click device arrow key left, right, up, down). How to make it?

View 1 Replies View Related

Android : EditText Movement On Keyboard Popup?

Jul 26, 2010

I have a LinearLayout that contains many views stacked vertically. However, at the bottom, I have an EditText.

Desired Result:-
When the keyboard popps up upon clicking the EditText, ONLY the EditText scrolls up while the rest of the screen remains static as it is. Is this possible? If yes how?

View 1 Replies View Related

Android :: Responding To Preference State Updates Logic

May 1, 2010

I am calling a PreferenceActivity from another activity and then updating the application state (ie: changing the font size) on onActivityResult, based on the preference changes. I was thinking it would be better to put the state update logic in the PreferenceActivity. That way I don't have the duplicate the logic in each activity that calls the PreferenceActivity. What's the best or correct way to do this?

View 2 Replies View Related

Android :: Detecting Shake Movement Without Draining Battery

Sep 10, 2009

I would like to detect shake movement in a service that is running in the background, even when the phone is not currently being used. Is it true that the only way to do this is to hold a wake lock? I suppose this would consume a lot of energy and drain the battery very fast.Is there no way to wake up the phone whenever a shake movement occurs? Maybe with the native sdk? I would imagine the accelerometer causing some kind of interrupt.

View 2 Replies View Related

HTC Incredible :: Searching Pictures (Math Problem) On Google?

Jun 23, 2010

I remember watching a commercial or seeing something about this phone where you could take a picture of lets say a math problem and then search it up on google. Is this true and is it an app that all android OS phones can use?

View 5 Replies View Related

Android :: BigFraction Class In The Apache-Commons-Math Library Return Incorrect Division Results?

May 14, 2010

In the spirit of using existing, tested and stable libraries of code, I started using the Apache-Commons-Math library and its BigFraction class to perform some rational calculations for an Android app I'm writing called RationalCalc.

It works great for every task that I have thrown at it, except for one nagging problem. When dividing certain BigFraction values, I am getting incorrect results.

If I create a BigFraction with the inverse of the divisor and multiply instead, I get the same incorrect answer but perhaps that is what the library is doing internally anyway.

Does anyone know what I am doing wrong?

The division works correctly with a BigFraction of 2.5 but not 2.51, 2.49, etc...

[UPDATE]

This was indeed a bug in the apache-commons-math 2.0 libraries. The bug is fixed in v.2.1.

It is now listed in the Fixed Issues section of the bug tracker:

When multiplying two BigFraction objects with numerators larger than will fit in an java-primitive int the result of BigFraction.ZERO is incorrectly returned..attempting to reproduce the issue and setting me on the right track.

CODE:.....................

View 1 Replies View Related

Motorola Droid :: Where To Get Scientific / Some Uber Math Calculus Calculator?

Feb 4, 2010

There has to be a better calculator out there, I mean CA MON! I am not looking for a scientific or some uber math calculus crazy calculator but I am looking for something that isn't so .

I mean we have a DROID! Why is this Calc so CRAPPY! Please tell me there is something out there, in the market, or even a 3rd party APK file.

View 19 Replies View Related

Motorola CLIQ :: Slight Vertical Y-Axis Screen Movement?

Apr 20, 2010

Is it normal in all Cliqs for the screen-half to be very slightly moveable in the up-and-down vertical direction, both in open and closed position? I'm not talking about inward and outward, but rather up and down on the vertical y-axis like from the ear speaker at the top to the mouth mic at the bottom. And I'm only talking about a millimeter of very slight movement if you hold your thumb down firmly or grab it with two fingers and try to move it.

View 2 Replies View Related

General :: Make Automated Movement Whenever Press Power Button?

Apr 29, 2013

Using Android, is it possible to automatically make your phone initiate a screen gesture (like a swipe across the screen) whenever you hit the power button, then proceed to turn off the phone? I know it's a very weird question, but I have my reasons.

I imagine it's possible with some type of app like Tasker, but I don't know if Tasker can initiate screen movements that imitate a finger moving across the screen in a point and direction of your choice.

View 5 Replies View Related

General :: LG L35g Optimus Logic Pause In ClockWorkMod Boot Loop

Jan 25, 2013

My stats:

LG L35g Optimus Logic from Net10
Running Android 2.3.6
It is rooted.
Clockworkmod 5.8.4.5

Okay, first off this is totally my fault that this phone is stuck.

I was inside the About menu of android and saw there was an update for 2.3.6

So, stupidly, I decided to select it. It downloaded the update, rebooted, and then wound up at the clockworkmod recovery screen.

I tried the "reboot system now" option, but it just reboots back to the recovery screen.

I have used the "wiped data/factory reset" option. I've wiped the cache partition and Dalvik cache.

I didn't backup the stock rom, so I found these two roms for the l35g from here:

AA51

Stock (user modded version)

I used the restore option in recovery mode, but the "Stock" rom above didn't take. The AA51 rom did install fully and told me to reboot. I did, but it still went right back into the boot-loop!

I think the solution to this is to fix the boot-loop issue. Would Zengarden or Xionia work? Then, if so, I need a version of it to work with the l35g.

View 1 Replies View Related

Android :: Capture Finger Movement Direction In Android Phone

Jun 30, 2010

I want to capture the finger movement direction on Android touch phone. If a user slides his finger in up/down/left/right direction, I want to capture this direction.

View 2 Replies View Related

Android :: How To Store Path Of Game Pawn In Turn Based Game?

May 22, 2010

I have a square grid, for a turn based game ( grid is similar to the chess board ), but the moves in the games are different based on whether you have lapped your opponent pawn at least once or not.i.e if you have not lapped (beaten any of the opponents pawns) in the outer most grid as below.if you have lapped your opponent pawn once at least, then you get to reach home,this way.Any player having all his pawns reaching "home" first wins.The ones in yellow are safe-houses, i.e both the opponent pawn and the player's pawn get to stay in the same grid, this is not considered to be lapping ( the opponent ).The lapped pawn will return to its start point.Now the question is, what is the effective way to store the paths for the all the pawns.we will have 4 pawns for the player and 4 opponent pawns.Is there any pattern to store such static information, in a elegant way?

View 1 Replies View Related

Android : Puzzle Game With 7x7 Grid Of Graphics / How To Save And Continue Game

Nov 12, 2010

I have a puzzle game with a 7x7 grid of graphics, and a timer, its just about ready to go. But I am stuck on how to go about saving/continuing game. For example when someone exits I want them to be able to save and exit, then come back and click continue to pick up where they left off with all of the graphics in the right place, timer and score. I looked at onSaveInstanceState android examples, but not sure if this is what I need or how to implement it in my case.

View 8 Replies View Related

Android :: What Logic Does Contacts Api Use To Aggregate - Overlapping Fields From Multiple Raw Contacts

Nov 2, 2010

when a "contact detail" screen is presented in the contacts application, how is each field aggregated from its underlying raw contacts

case 1: Overlapping fields

when the same field exists in two or more contacts. Say they have two different last names or emails in different accounts. Does the contacts app show both fields with an account indicator?

case 2: Non overlapping fileds

one rawcontact has email while the other one has phone number

Short of scouring the source code, I have exhausted searching everywhere else.

View 2 Replies View Related

Games :: HD Games - Only 1/4 Of The Whole Game Screen Is Viewed - Liked Zoomed The Game

Oct 16, 2010

I got Samsung Galaxy 5.

I got some gameloft games (HD versions) installed but as I Run them only Top left (approx 1/4)view of game screen appers.

As whole game can not to fitted on one screen..

|--------------------|
| |
| |
| |
|Gamel |
| |
|--------------------

It looks like half of screen is cut like on "oft" of Gameloft is invisible

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved