# Scrolling Problem

**URL:** <https://forum.kirupa.com/t/scrolling-problem/151647>\
**Category:** Uncategorized\
**Created:** [June 17, 2005, 1:06am UTC](https://forum.kirupa.com/t/scrolling-problem/151647 "2005-06-17T01:06:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crompee](https://avatars.discourse-cdn.com/v4/letter/c/c4cdca/32.png) [@Crompee](https://forum.kirupa.com/u/Crompee)\
**Post date:** [June 17, 2005, 1:06am UTC](https://forum.kirupa.com/t/scrolling-problem/151647/1 "2005-06-17T01:06:20Z")

</div>

im currently making a gta style game, but ive come across a problem, which i cant figure out how to solve.

im trying to make it, so the character always stays in the middle of the screen i.e. the background moves instead, but i havent been able to figure out a way, to implement it.

Also note, that i still want the player to be able to rotate on the spot (so the background does not rotate), and then when the player moves forward or backwards, the background moves.

i only started construction of this game 10mins ago, but thought if i dont solve this problem now, it will only be harder to solve as i progress through the making of the game. The current code i have for the character is as follows:

```php

onClipEvent(load){
	movementSpeed=5
	rotationSpeed=15
}

onClipEvent (enterFrame) {	
	if (Key.isDown(Key.RIGHT)) { this._rotation += rotationSpeed; }
	if (Key.isDown(Key.LEFT)) { this._rotation -= rotationSpeed; }
	if (Key.isDown(Key.UP)) {
		this._y += movementSpeed*Math.cos((_rotation+180)*(Math.PI/180));
		this._x -= movementSpeed*Math.sin((_rotation+180)*(Math.PI/180));
	}
	if (Key.isDown(Key.DOWN)) {
		this._y -= (movementSpeed/3)*Math.cos((_rotation+180)*(Math.PI/180));
		this._x += (movementSpeed/3)*Math.sin((_rotation+180)*(Math.PI/180));
	}
}

```

so at the moment, the character rotates on the spot, and moves forwards and backwards.

thx for your help in advance… i hope :ne:
