give direction to sprite
Hi! I have a sprite which i move by touching it...i drag it all around the screen an d when i leave it I want it to move to the direction wheew my hand was moving...I mean...drag and move,leave it,continue moving to the direction pointed by me.
You want to find the velocity vector of the sprite and you know two vectors:
- position of sprite
- position of target
Google vector subtraction.
- position of sprite
- position of target
Google vector subtraction.
Thanks but what should i use?BOX2d?Im new and I have no idea..any help please!!
The problem as stated wouldn't require a physics engine like Box2D, just some simple interpolation/velocity code. We'll be able to help you more if you post some detailed information about what you're trying to do and what's giving you trouble; there isn't a whole lot to go on from what you've posted so far.
Im sorry but i I cant post code..what i want is when touch ended method gets called,the code will have "saved" the direction to which my hand was pointing before i release the sprite and then to automatucally continue moving the onject to that direction.
Are you new to programming? Games? iPhone programming? You're going to have to write code in a computer language to accomplish what you want. Programming isn't something you can just decide to pick up one day and start cranking out games.
So if a is the position of the target, and b is the position of the sprite...
compiler - what program did you use to make those arrow images?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Smooth acceleration in every direction. | Honey Sharma | 1 | 3,533 |
Aug 16, 2011 01:37 AM Last Post: PoseMotion |
|
| newbie request direction | Teehee | 3 | 5,437 |
Jul 27, 2011 09:57 AM Last Post: AndyKorth |
|
| PVRTexture loader give error 0x0500 | sefiroths | 2 | 4,132 |
Mar 25, 2011 03:52 AM Last Post: sefiroths |
|
| Direction of normal | Miglu | 3 | 3,075 |
Oct 4, 2010 05:08 PM Last Post: Skorche |
|
| Direction formula? | TimMcD | 2 | 4,186 |
Nov 11, 2009 11:42 PM Last Post: TimMcD |
|

