Code:
if ActTime > 10 then
begin
Blurp.vx:=0;
Blurp.vy:=0;
if GetKeyState(VK_LEFT) < 0 then
begin
Blurp.vx:=-80;
if (Blurp.X > 320) and (Blurp.X < (40*64)-320) then
begin
AdSpriteEngine.X:=(Blurp.X*-1)+320;
end;
end;
if GetKeyState(VK_RIGHT) < 0 then
begin
Blurp.vx:=80;
if (Blurp.X > 320) and (Blurp.X < (40*64)-320) then
begin
AdSpriteEngine.X:=(Blurp.X*-1)+320;
end;
end;
if GetKeyState(VK_UP) < 0 then
begin
Blurp.vy:=-80;
if (Blurp.Y > 240) and (Blurp.Y < (29*64)-240) then
begin
AdSpriteEngine.Y:=(Blurp.Y*-1)+240;
end;
end;
if GetKeyState(VK_DOWN) < 0 then
begin
Blurp.vy:=80;
if (Blurp.Y > 240) and (Blurp.Y < (29*64)-240) then
begin
AdSpriteEngine.Y:=(Blurp.Y*-1)+240;
end;
end;
ActTime := 0;
end;
Due to the fact that I use 60 FPS limit... had to decrease ACT TIME to 10... I don't know what to call this effect but when ACT TIME was 60... the screen was moving... I dunnot a bit erm... tear effect ... the outer lines of my character seemed to be jumping in and out of the character when it was redrawn...
Anyway now it works great , and was pretty simple to do to. Only thing, gravity...tomorrow.
Greetings
Rob
ps. : once I'm finished with my experiments...I'll use const and more variables instead of manually putting in numbers....
Bookmarks