public RenderObject move(int dx, int dy, Set<RenderObject> allObjects) {
		
		RenderObject collision = null;
		
		if (hasCollision) {
			// We need to check for collision.
			
			// Create a set for all possible collision targets.
			Set<RenderObject> collisionTargets = new HashSet<RenderObject>();
			
			// Add all _other_ objects that have collision.
			for (RenderObject object : allObjects) {
				
				if (object != this && object.hasCollision) {
					collisionTargets.add(object);
				}
			}
			
			// Simple algorithm:
			
			// 1. Calculate the number of movement steps.
			int steps = Math.max(Math.abs(dx), Math.abs(dy));
			
			// Calculate the speed in the two dimensions.
			// This can be fractions, thus we need to use floats.
			float speedX = ((float) dx) / steps;
			float speedY = ((float) dy) / steps;
			
			// As we are working with floats for the speed, we need
			// to use floats for the position too.
			float positionX = this.x;
			float positionY = this.y;
			
			// 2. Move "step by step" into the desired direction.
			for (int step = 0; step < steps; step++) {
				
				// Perform the next step.
				positionX += speedX;
				positionY += speedY;
				
				// Update the position of this object.
				this.x = Math.round(positionX);
				this.y = Math.round(positionY);
				
				// Check if there is a collision now.
				for (RenderObject object : collisionTargets) {
					
					if (overlapsWithObject(object)) {
						// There is a collision!
						collision = object;
						
						// Exit the loop of checking for collisions directly.
						break;
					}
				}
				
				if (collision != null) {
					// There was a collision!
					
					// Move one step back, to the last position, because
					// there was no collision there.
					positionX -= speedX;
					positionY -= speedY;
					
					// Set the positions to this last position.
					this.x = Math.round(positionX);
					this.y = Math.round(positionY);
					
					// Exit the moving loop, since we have a collision and we
					// cannot move further.
					break;
				}
				
			}
			
			
		} else {
			// This object has no collision, just update the coordinates.

			this.x += dx;
			this.y += dy;
		}
		
		if (collision != null) {
			Log.info("There was a collision!");
		}
		
		return collision;
	}