mirror of
https://github.com/stevenhowes/CTheEscape.git
synced 2026-05-26 15:53:29 +01:00
Left/bottom bounds, and move a tile at a time rather than with a pointless cursor.
This commit is contained in:
Binary file not shown.
Binary file not shown.
+42
-16
@@ -129,44 +129,70 @@ void game2_tick_input()
|
|||||||
// Up arrow
|
// Up arrow
|
||||||
if(input_readkey(57))
|
if(input_readkey(57))
|
||||||
{
|
{
|
||||||
TilePlayer.location.Y += 6 * (tick - lasttick);
|
if(tick > readmodkey)
|
||||||
if(TilePlayer.location.Y > (950))
|
|
||||||
{
|
{
|
||||||
TilePlayer.location.Y = 100;
|
TilePlayer.location.Y += 100;
|
||||||
TilePlayer.mapoffset.Y += 10;
|
if(TilePlayer.location.Y > (950))
|
||||||
|
{
|
||||||
|
TilePlayer.location.Y = 50;
|
||||||
|
TilePlayer.mapoffset.Y += 10;
|
||||||
|
}
|
||||||
|
readmodkey = tick + 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Down arrow
|
// Down arrow
|
||||||
if(input_readkey(41))
|
if(input_readkey(41))
|
||||||
{
|
{
|
||||||
TilePlayer.location.Y -= 6 * (tick - lasttick);
|
if(tick > readmodkey)
|
||||||
if(TilePlayer.location.Y < (10))
|
|
||||||
{
|
{
|
||||||
TilePlayer.location.Y = 900;
|
TilePlayer.location.Y -= 100;
|
||||||
TilePlayer.mapoffset.Y -= 10;
|
if(TilePlayer.location.Y < (10))
|
||||||
|
{
|
||||||
|
if(TilePlayer.mapoffset.Y > 0)
|
||||||
|
{
|
||||||
|
TilePlayer.location.Y = 950;
|
||||||
|
TilePlayer.mapoffset.Y -= 10;
|
||||||
|
}else{
|
||||||
|
TilePlayer.location.Y += 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readmodkey = tick + 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Right arrow
|
// Right arrow
|
||||||
if(input_readkey(121))
|
if(input_readkey(121))
|
||||||
{
|
{
|
||||||
TilePlayer.location.X += 6 * (tick - lasttick);
|
if(tick > readmodkey)
|
||||||
if(TilePlayer.location.X > (950))
|
|
||||||
{
|
{
|
||||||
TilePlayer.location.X = 100;
|
TilePlayer.location.X += 100;
|
||||||
TilePlayer.mapoffset.X += 10;
|
if(TilePlayer.location.X > (950))
|
||||||
|
{
|
||||||
|
TilePlayer.location.X = 50;
|
||||||
|
TilePlayer.mapoffset.X += 10;
|
||||||
|
}
|
||||||
|
readmodkey = tick + 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Left arrow
|
// Left arrow
|
||||||
if(input_readkey(25))
|
if(input_readkey(25))
|
||||||
{
|
{
|
||||||
TilePlayer.location.X -= 6 * (tick - lasttick);
|
if(tick > readmodkey)
|
||||||
if(TilePlayer.location.X < (10))
|
|
||||||
{
|
{
|
||||||
TilePlayer.location.X = 900;
|
TilePlayer.location.X -= 100;
|
||||||
TilePlayer.mapoffset.X -= 10;
|
if(TilePlayer.location.X < (10))
|
||||||
|
{
|
||||||
|
if(TilePlayer.mapoffset.X > 0)
|
||||||
|
{
|
||||||
|
TilePlayer.location.X = 950;
|
||||||
|
TilePlayer.mapoffset.X -= 10;
|
||||||
|
}else{
|
||||||
|
TilePlayer.location.X += 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readmodkey = tick + 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user