Sprites 'sliding' against tiled background.

Get help using Construct 2

Post » Thu May 30, 2013 6:16 pm

Here's the capx showing my issue ... Capx

I have a tiled background, 256x256, which I'm positioning relative to the player's 'map' location (the player is held steady in the exact centre of the screen and everything revolves around him). So to find the location of the tiled background, I use a 'mod 256' calculation.

Then to find the location of enemy ships (which are also placed relative to the player at the centre of the screen), I just need the relative placement, e.g Enemy.X = Player.X + (Enemy.MapX-Player.MapX).

As pointed out below, the enemies are the light blue blocks.

Both calculations are 'correct' (I think) but it leaves a strange effect where the enemies 'slide' against the background. I'm guessing this is because the enemy positions aren't integers and the tiled background is set to exact integers because of the mod function.

Any ideas on how to correct this? Is there a way I could position the scrolling background more accurately without using mod?farflamex2013-05-30 23:45:51
B
26
S
6
G
4
Posts: 456
Reputation: 5,853

Post » Thu May 30, 2013 10:46 pm

Enemies don't seem to spawn at all in your .capx, could you add them back in so we can see the problem?
B
16
S
4
Posts: 24
Reputation: 1,009

Post » Thu May 30, 2013 11:43 pm

My bad, should have pointed out that the light blue blocks are the enemies. I just haven't put a graphic in yet. The blocks do make the effect very obvious.farflamex2013-05-30 23:46:33
B
26
S
6
G
4
Posts: 456
Reputation: 5,853


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests