Results 1 to 10 of 31

Thread: Collission detection on level ( source Travels doc + some other examples)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #30

    Scrolling works now , ... and unfortunatelly gotta go get some sleep... :(

    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....
    Last edited by robert83; 21-08-2011 at 12:56 AM. Reason: changed source

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •