Search Results

Search found 1061 results on 43 pages for 'movement'.

Page 8/43 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Moving the jBullet collision body to with the player object

    - by Kenneth Bray
    I am trying to update the location of the rigid body for a player class, as my player moves around I would like the collision body to also move with the player object (currently represented as a cube). Below is my current update method for when I want to update the xyz coords, but I am pretty sure I am not able to update the origin coords? : public void Update(float pX, float pY, float pZ) { posX = pX; posY = pY; posZ = pZ; //update the playerCube transform for the rigid body cubeTransform.origin.x = posX; cubeTransform.origin.y = posY; cubeTransform.origin.z = posZ; cubeRigidBody.getMotionState().setWorldTransform(cubeTransform); processTransformMatrix(cubeTransform); } I do not have rotation updated, as I do not actually want/need the player body to rotate at all currently. However, in the final game this will me put in place.

    Read the article

  • XNA - 2D Rotation of an object to a selected direction

    - by lobsterhat
    I'm trying to figure out the best way of rotating an object towards the directional input of the user. I'm attempting to mimic making turns on ice skates. For instance, if the player is moving right and the input is down and left, the player should start rotating to the right a set amount each tick. I'll calculate a new vector based on current velocity and rotation and apply that to the current velocity. That should give me nice arcing turns, correct? At the moment I've got eight if/else statements for each key combination which in turn check the current rotation: // Rotate to 225 if (keyboardState.IsKeyDown(Keys.Up) && keyboardState.IsKeyDown(Keys.Left)) { // Rotate right if (rotation >= 45 || rotation < 225) { rotation += ROTATION_PER_TICK; } // Rotate left else if (rotation < 45 || rotation > 225) { rotation -= ROTATION_PER_TICK; } } This seems like a sloppy way to do this and eventually, I'll need to do this check about 10 times a tick. Any help toward a more efficient solution is appreciated.

    Read the article

  • I am looking to make a spaceship tilt as it corners but I cant get it to return

    - by bobthemac
    I am using the TL game engine I am not allowed to use a physics engine but I need to make the spaceship lean as it corners, I can make it lean but cannot make it return to its starting position. I have looked at implementing some kind of spring physics but I don't understand it. Here is my code so far if(myEngine->KeyHeld(Key_A)) { car->RotateY(carSteer * frameTime); if(carSteer >= -carMaxSteer) { carSteer -= carSteerIncrement; car->RotateLocalZ(-(carSteer * frameTime)); } } if(!myEngine->KeyHeld(Key_A)) { if(carSteer < 0) { carSteer = 0; } } if(myEngine->KeyHeld(Key_D)) { car->RotateY(carSteer * frameTime); if(carSteer <= carMaxSteer) { carSteer += carSteerIncrement; car->RotateLocalZ(-(carSteer * frameTime)); } } if(!myEngine->KeyHeld(Key_D)) { if(carSteer > 0) { carSteer = 0; } } All the functions I am calling are built into the engine and I did not write them. Any Help Would Be Appreciated Thanks.

    Read the article

  • XNA move from start position to target position exactly in 3D

    - by robasaurus
    If I have a list of positions that map out a path a character should follow. What would be the best way to move at a constant speed to each position making sure the character lands exactly at each position before moving onto the next? For example the character is at position A, we then queue up position B and position C. The character cannot move towards position C until it reaches position B exactly. It would be great if the solution worked at slower frame rates/update speeds as well.

    Read the article

  • Crash when trying to detect touch

    - by iQue
    I've got a character in a 2D game using surfaceView that I want to be able to move using a button (eventually a joystick), but my game crashes as soon as I try to move my sprite. This is my onTouch-method for my steering button: public void handleActionDown(int eventX, int eventY) { if (eventX >= (x - bitmap.getWidth() / 2) && (eventX <= (x + bitmap.getWidth()/2))) { if (eventY >= (y - bitmap.getHeight() / 2) && (y <= (y + bitmap.getHeight() / 2))) { setTouched(true); } else { setTouched(false); } } else { setTouched(false); } And if I try to put this in my update-method: public void update() { x += (speed.getXv() * speed.getxDirection()); y += (speed.getYv() * speed.getyDirection()); } The sprite moves on its own just fine, but as soon as I add: public void update() { if(steering.isTouched()){ x += (speed.getXv() * speed.getxDirection()); y += (speed.getYv() * speed.getyDirection()); } the game crashes. Does anyone know why this is or how to fix it? I cannot figure it out. I'm using MotionEvent.ACTION_DOWN to check if the user if pressing the screen.

    Read the article

  • Space Invaders-type game: Keeping the enemies aligned with each other as they turn around?

    - by CorundumGames
    OK, so here's the lowdown of the problem I'm trying to solve. I'm developing a game in PyGame that's a cross between Space Invaders and Columns. I'm trying to make the motion of the enemies similar to that of the aliens in Space Invaders; that is, they're all clustered in a grid, and if even one hits the side of the screen, the entire formation moves down and turns around. However, the motion of these aliens is continuous (as continuous as a monitor can be, anyway), not on a discrete grid like in the original. The enemies are instances of an Enemy class, and in turn they're held by a 2D array in a enemysquadron module (which, if you don't use Python, is in this case essentially a singleton due to the way Python modules work). Inside the Enemy class I have a class-scope velocity vector that is reversed every time an Enemy object touches the edge of the screen. This won't do, though, because as time goes on the enemies just become disorganized and jumbled (i.e. not in a grid as planned). I haven't implemented the Enemies going downward yet, so let's not worry about that right now. Any tips?

    Read the article

  • two guitexture that do not work together

    - by London2423
    I have two GUITexture that move left and right a cube. Is pretty strange but together they don't work. If I activate only one it works. To be more specific: If I have the left GUItexture alone in the game the cube move left. If I have the right GUITexture activated alone the cube move right. Seems all fine I thought but If I have both of them the cube move only right and not left. Where is the mistake? Here is the code inside the GameObject cube for Right move void OnMousedown () { transform.position += Vector3.right * Time.deltaTime; } For Left move void OnMousedown () { transform.position += Vector3.left * Time.deltaTime; } And this is the left GUITexture code //move the cube left Cube.GetComponent<Left> ().enabled = true; left.transform.position += Vector3.left * Time.deltaTime; This is the right GUITexture //move the cube right Cube.GetComponent<Left> ().enabled = true; right.transform.position += Vector3.right * Time.deltaTime; What is the reason for this? I hope someone can help me.

    Read the article

  • How do I implement deceleration for the player character?

    - by tesselode
    Using delta time with addition and subtraction is easy. player.speed += 100 * dt However, multiplication and division complicate things a bit. For example, let's say I want the player to double his speed every second. player.speed = player.speed * 2 * dt I can't do this because it'll slow down the player (unless delta time is really high). Division is the same way, except it'll speed things way up. How can I handle multiplication and division with delta time? Edit: it looks like my question has confused everyone. I really just wanted to be able to implement deceleration without this horrible mass of code: else if speed > 0 then speed = speed - 20 * dt if speed < 0 then speed = 0 end end if speed < 0 then speed = speed + 20 * dt if speed > 0 then speed = 0 end end end Because that's way bigger than it needs to be. So far a better solution seems to be: speed = speed - speed * whatever_number * dt

    Read the article

  • The input doesn't recognize that I release the key?

    - by joapet99
    I'm creating a window (JOptionPane), in response to a collision. However, if the player is holding a key down when the window pops up, the input doesn't trigger a key release when the key is released. I don't think you can just check it with a isRelease function in the input, since the input is kind of corrupt. Can you help me? The way I check if the key is down: if(input.isKeyDown(Input.KEY_A)&& TestLevel.isFighting == false){ if(owner.canMoveLeft){ position.x -= speed * delta; } } I am not handling the key release by myself, but if I check if the key is down it should work. But it doesn't.

    Read the article

  • enemy behavior with boundary to change direction

    - by BadSniper
    I'm doing space shooter kind of game, the logic is to reflect the enemy if it hits the boundary. With my logic, sometimes enemy behaves like flickering instead of changing the velocity. It's like trapped in the boundary and checking for if loops. This is my code for velocity changing: if(this->enemyPos.x>14) { this->enemyVel.x = -this->enemyVel.x; } if(this->enemyPos.x<-14) { this->enemyVel.x = -this->enemyVel.x; } How can I get around this? Its going out of boundary and don't know where to go and after sometimes its coming into field. I know whats the problem is, I dont know how to get around this problem.

    Read the article

  • what's wrong with my lookAt and move forward code?

    - by alaslipknot
    so am still in the process of getting familiar with libGdx and one of the fun things i love to do is to make basics method for reusability on future projects, and for now am stacked on getting a Sprite rotate toward target (vector2) and then move forward based on that rotation the code am using is this : // set angle public void lookAt(Vector2 target) { float angle = (float) Math.atan2(target.y - this.position.y, target.x - this.position.x); angle = (float) (angle * (180 / Math.PI)); setAngle(angle); } // move forward public void moveForward() { this.position.x += Math.cos(getAngle())*this.speed; this.position.y += Math.sin(getAngle())*this.speed; } and this is my render method : @Override public void render(float delta) { // TODO Auto-generated method stub Gdx.gl.glClearColor(0, 0, 0.0f, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // groupUpdate(); Vector3 mousePos = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0); camera.unproject(mousePos); ball.lookAt(new Vector2(mousePos.x, mousePos.y)); // if (Gdx.input.isTouched()) { ball.moveForward(); } batch.begin(); batch.draw(ball.getSprite(), ball.getPos().x, ball.getPos().y, ball .getSprite().getOriginX(), ball.getSprite().getOriginY(), ball .getSprite().getWidth(), ball.getSprite().getHeight(), .5f, .5f, ball.getAngle()); batch.end(); } the goal is to make the ball always look at the mouse cursor, and then move forward when i click, am also using this camera : // create the camera and the SpriteBatch camera = new OrthographicCamera(); camera.setToOrtho(false, 800, 480); aaaand the result was so creepy lol Thank you

    Read the article

  • Move sprite in the direction it is facing?

    - by rphello101
    I'm using Java/Slick 2D. I'm trying to use the mouse to rotate the sprite and the arrow keys to move the sprite. I can get the sprite to rotate no problem, but I cannot get it to move in the direction it is supposed to. When I hit "forwards", the sprite doesn't necessarily move towards the mouse. I'm sure there has to be some standard code for this since many games use this style of motion. Can anyone help me out with what the trig is supposed to be? Thanks

    Read the article

  • How to manage enemy deplacement and shoot in a shmup?

    - by whatever
    I'm wondering what is the best (or at least a good) way of managing enemies in a shoot-em-up. Basically, what I'd do would be a class that manages displaying and updating positions of all the enemies. But how to create good deplacements for enemies? A list of where-to-go points? gravitating around some fixed points (with ponderation, distance evaluation etc.)? Same question for the shoot patterns? Can you please put me on a track?

    Read the article

  • Can a high FPS negatively affect how a program runs?

    - by rphello101
    Yeah I know this is a broad question and will get down rated, I'm just hoping for some answer before it gets closed. Anyway, I'm using Slick 2D/Java to play around with graphics. I'm having some trouble with trying to move an image. The weird thing is, the code works just fine on my laptop, but the image sporadically moves to (0,0) and stops on my desktop. The only difference between the two is that it says the FPS is about 500 on my laptop and 6600 on my desktop. Can that affect it or does someone have any ideas for what to check on?

    Read the article

  • Limiting the speed of a dragged sprite in Cocos2dx

    - by Frozsht
    I am trying to drag a row of sprites using ccTouchesMoved. By that I mean that there is a row of sprites (they are colored squares) lined up next to each other and if I grab one with a touch the rest follow it. However, if the sprite that is selected by touch moves too fast it creates a slight gap between it and the following sprites. How do I go about limiting the speed that I can drag the sprite with ccTouchesMoved? This is the only solution I could think of to my problem. If anyone has another suggestion to prevent this sprite gap from happening I would appreciate it.

    Read the article

  • Could not continue scan with NOLOCK due to data movement during installation

    - by dbdev1
    I am running Windows Server 2008 Standard Edition R2 x64 and I installed SQL Server 2008 Developer Edition. All of the preliminary checks run fine (Apart from a warning about Windows Firewall and opening ports which is unrelated to this and shouldn't be an issue - I can open those ports). Half way through the actual installation, I get a popup with this error: Could not continue scan with NOLOCK due to data movement. The installation still runs to completion when I press ok. However, at the end, it states that the following services "failed": database engine services sql server replication full-text search reporting services How do I know if this actually means that anything from my installation (which is on a clean Windows Server setup - nothing else on there, no previous SQL Servers, no upgrades, etc) is missing? I know from my programming experience that locks are for concurrency control and the Microsoft help on this issue points to changing my query's lock/transactions in a certain way to fix the issue. But I am not touching any queries? Also, now that I have installed the app, when I login, I keep getting this message: TITLE: Connect to Server ------------------------------ Cannot connect to MSSQLSERVER. ------------------------------ ADDITIONAL INFORMATION: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 67) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=67&LinkId=20476 ------------------------------ BUTTONS: OK ------------------------------ I went into the Configuration Manager and enabled named pipes and restarted the service (this is something I have done before as this message is common and not serious). I have disabled Windows Firewall temporarily. I have checked the instance name against the error logs. Please advise on both of these errors. I think these two errors are related. Thanks

    Read the article

  • Could not continue scan with NOLOCK due to data movement during installation

    - by dbdev1
    Hi, I am running Windows Server 2008 Standard Edition R2 x64 and I installed SQL Server 2008 Developer Edition. All of the preliminary checks run fine (Apart from a warning about Windows Firewall and opening ports which is unrelated to this and shouldn't be an issue - I can open those ports). Half way through the actual installation, I get a popup with this error: Could not continue scan with NOLOCK due to data movement. The installation still runs to completion when I press ok. However, at the end, it states that the following services "failed": database engine services sql server replication full-text search reporting services How do I know if this actually means that anything from my installation (which is on a clean Windows Server setup - nothing else on there, no previous SQL Servers, no upgrades, etc) is missing? I know from my programming experience that locks are for concurrency control and the Microsoft help on this issue points to changing my query's lock/transactions in a certain way to fix the issue. But I am not touching any queries? Also, now that I have installed the app, when I login, I keep getting this message: TITLE: Connect to Server Cannot connect to MSSQLSERVER. ADDITIONAL INFORMATION: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 67) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=67&LinkId=20476 BUTTONS: OK I went into the Configuration Manager and enabled named pipes and restarted the service (this is something I have done before as this message is common and not serious). I have disabled Windows Firewall temporarily. I have checked the instance name against the error logs. Please advise on both of these errors. I think these two errors are related. Thanks

    Read the article

  • Simulate mouse movement in Ubuntu

    - by Dave Jarvis
    Problem Am looking to automatically move the mouse cursor and simulate mouse button clicks from the command-line using an external script. Am not looking to: Record mouse movement and playback (e.g., xnee, xmacro) Instantly move the mouse from one location to another (e.g., xdotool, Python's warp_pointer) Ideal Solution What I'd like to do is the following: Edit a simple script file (e.g., mouse-script.txt). Add a list of coordinates, movement speeds, delays, and button clicks. For example: (x, y, rate) = (500, 500, 50) sleep = 5 click = left Run the script: xsim < mouse-script.txt. Question How do you automate mouse movement so that it transitions from its current location to another spot on the screen, at a specific velocity? For example: xdotool mousemove 500 500 --rate 50 The --rate 50 doesn't exist with xdotool. I could write a script that uses xdotool to get the current mouse coordinates then move it a pixel at a time to the destination with a suitable sleep interval; what automated testing tool already does this? Thank you.

    Read the article

  • Java: how to register a listener that listen to a JFrame movement

    - by cocotwo
    How can you track the movement of a JFrame itself? I'd like to register a listener that would be called back every single time JFrame.getLocation() is going to return a new value. Here's a skeleton that compiles and runs, what kind of listener should I add so that I can track every JFrame movement on screen? import javax.swing.*; public class SO { public static void main( String[] args ) throws Exception { SwingUtilities.invokeAndWait( new Runnable() { public void run() { final JFrame jf = new JFrame(); final JPanel jp = new JPanel(); final JLabel jl = new JLabel(); updateText( jf, jl ); jp.add( jl ); jf.add( jp ); jf.pack(); jf.setVisible( true ); } } ); } private static void updateText( final JFrame jf, final JLabel jl ) { jl.setText( "JFrame is located at: " + jf.getLocation() ); jl.repaint(); } }

    Read the article

  • Optimising movement on hex grid

    - by Mloren
    I am making a turn based hex-grid game. The player selects units and moves them across the hex grid. Each tile in the grid is of a particular terrain type (eg desert, hills, mountains, etc) and each unit type has different abilities when it comes to moving over the terrain (e.g. some can move over mountains easily, some with difficulty and some not at all). Each unit has a movement value and each tile takes a certain amount of movement based on its terrain type and the unit type. E.g it costs a tank 1 to move over desert, 4 over swamp and cant move at all over mountains. Where as a flying unit moves over everything at a cost of 1. The issue I have is that when a unit is selected, I want to highlight an area around it showing where it can move, this means working out all the possible paths through the surrounding hexes, how much movement each path will take and lighting up the tiles based on that information. I got this working with a recursive function and found it took too long to calculate, I moved the function into a thread so that it didn't block the game but still it takes around 2 seconds for the thread to calculate the moveable area for a unit with a move of 8. Its over a million recursions which obviously is problematic. I'm wondering if anyone has an clever ideas on how I can optimize this problem. Here's the recursive function I'm currently using (its C# btw): private void CalcMoveGridRecursive(int nCenterIndex, int nMoveRemaining) { //List of the 6 tiles adjacent to the center tile int[] anAdjacentTiles = m_ThreadData.m_aHexData[nCenterIndex].m_anAdjacentTiles; foreach(int tileIndex in anAdjacentTiles) { //make sure this adjacent tile exists if(tileIndex == -1) continue; //How much would it cost the unit to move onto this adjacent tile int nMoveCost = m_ThreadData.m_anTerrainMoveCost[(int)m_ThreadData.m_aHexData[tileIndex].m_eTileType]; if(nMoveCost != -1 && nMoveCost <= nMoveRemaining) { //Make sure the adjacent tile isnt already in our list. if(!m_ThreadData.m_lPassableTiles.Contains(tileIndex)) m_ThreadData.m_lPassableTiles.Add(tileIndex); //Now check the 6 tiles surrounding the adjacent tile we just checked (it becomes the new center). CalcMoveGridRecursive(tileIndex, nMoveRemaining - nMoveCost); } } } At the end of the recursion, m_lPassableTiles contains a list of the indexes of all the tiles that the unit can possibly reach and they are made to glow. This all works, it just takes too long. Does anyone know a better approach to this?

    Read the article

  • Ideas for jumping in 2D with Actionscript 3 [included attempt]

    - by befall
    So, I'm working on the basics of Actionscript 3; making games and such. I designed a little space where everything is based on location of boundaries, using pixel-by-pixel movement, etc. So far, my guy can push a box around, and stops when running into the border, or when try to the push the box when it's against the border. So, next, I wanted to make it so when I bumped into the other box, it shot forward; a small jump sideways. I attempted to use this (foolishly) at first: // When right and left borders collide. if( (box1.x + box1.width/2) == (box2.x - box2.width/2) ) { // Nine times through for (var a:int = 1; a < 10; a++) { // Adds 1, 2, 3, 4, 5, 4, 3, 2, 1. if (a <= 5) { box2.x += a; } else { box2.x += a - (a - 5)*2 } } } Though, using this in the function I had for the movement (constantly checking for keys up, etc) does this all at once. Where should I start going about a frame-by-frame movement like that? Further more, it's not actually frames in the scene, just in the movement. This is a massive pile of garbage, I apologize, but any help would be appreciated.

    Read the article

  • Problem animating in Unity/Orthello 2D. Can't move gameObject

    - by Nelson Gregório
    I have a enemy npc that moves left and right in a corridor. It's animated with 2 sprites using Orthello 2D Framework. If I untick the animation's play on start and looping, the npc moves correctly. If I turn it on, the npc tries to move but is pulled back to his starting position again and again because of the animation loop. If I turn looping off during runtime, the npc moves correctly again. What did I do wrong? Here's the npc code if needed. using UnityEngine; using System.Collections; public class Enemies : MonoBehaviour { private Vector2 movement; public float moveSpeed = 200; public bool started = true; public bool blockedRight = false; public bool blockedLeft = false; public GameObject BorderL; public GameObject BorderR; void Update () { if (gameObject.transform.position.x < BorderL.transform.position.x) { started = false; blockedRight = false; blockedLeft = true; } if (gameObject.transform.position.x > BorderR.transform.position.x) { started = false; blockedLeft = false; blockedRight = true; } if(started) { movement = new Vector2(1, 0f); movement *= Time.deltaTime*moveSpeed; gameObject.transform.Translate(movement.x,movement.y, 0f); } if(!blockedRight && !started && blockedLeft) { movement = new Vector2(1, 0f); movement *= Time.deltaTime*moveSpeed; gameObject.transform.Translate(movement.x,movement.y, 0f); } if(!blockedLeft && !started && blockedRight) { movement = new Vector2(-1, 0f); movement *= Time.deltaTime*moveSpeed; gameObject.transform.Translate(movement.x,movement.y, 0f); } } }

    Read the article

  • (solved) jQuery click and drag/scroll window: jagged movement

    - by Josh
    Edit: derp, using pageX/Y instead of clientX/Y -- apparently scrollBy expects input with that offset rather than the other. Jaggy movement gone. I am getting jagged movement when doing small scroll increments using the following bindings. Can anyone point me in the right direction for how to smooth this out? FYI, its intermittent. It seems like, if I click and hold for a second, then drag at a decent speed there are no problems. Edit: What the hell? I get this output on debug... obvious jog backwards and forwards. This will happen in succession and seems to have no correlation with the mouse, other than the mouse is moving. x 398 : 403 y 374 : 377 x 403 : 399 y 377 : 374 x 399 : 404 y 374 : 377 Josh sococo.client.panMap = function(e){ e.preventDefault(); var movex = sococo.client.currX - e.pageX ; var movey = sococo.client.currY - e.pageY; console.log( sococo.client.currX +" : " + e.pageX ); window.scrollBy(movex,movey); sococo.client.currY = e.pageY; sococo.client.currX = e.pageX; } $(document).mousedown( function(e){ e.preventDefault(); sococo.client.currX = e.pageX; sococo.client.currY = e.pageY; $(document).bind( "mousemove", sococo.client.panMap ); }); $(document).mouseup( function(e){ e.preventDefault(); $(document).unbind( "mousemove", sococo.client.panMap ); });

    Read the article

  • iPhone: Strange Movement of Two UIImageView "Sprites"

    - by David Pollak
    I have two UIImageViews moving like sprites on a superview. Each imageview moves properly by itself but when I put both imageviews on the superview at the same time, their individual movement becomes strangely restricted to two different areas of the screen. They will not touch even programmed to the same coordinates. This is my movement code for the first imageView: - (void)viewDidLoad { [super viewDidLoad]; pos = CGPointMake(14.0, 7.0); [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(onTimer) userInfo:nil repeats:YES]; } - (void) onTimer { pallone.center = CGPointMake(pallone.center.x+pos.x, pallone.center.y+pos.y); if(pallone.center.x > 320 || pallone.center.x < 0) pos.x = -pos.x; if(pallone.center.y > 480 || pallone.center.y < 0) pos.y = -pos.y; } and for the second imageview: - (IBAction)spara{ cos = CGPointMake(8.0, 4.0); [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(inTimer) userInfo:nil repeats:YES]; } - (void)inTimer{ bomba.center = CGPointMake(bomba.center.x+pos.x, bomba.center.y+pos.y); if(bomba.center.x > 50 || bomba.center.x < 0) pos.x = -pos.x; if(bomba.center.y > 480 || bomba.center.y < 0) pos.y = -pos.y; } Why causes this strange behavior? Thanks for your help. I am a newbie.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >