Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Oh collision, thou art a villian so foul
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rcbhs




PostPosted: Tue Jan 19, 2010 9:38 am   Post subject: Oh collision, thou art a villian so foul

Ok so I have a gun and one bullet right now and I'm about to use it. Why won't my guy land on platforms? I'm bout rdy to cry, then die.

Anyways, don't worry about efficiency and such, I just need this stupid little dude to land on the freaking platforms and he wont. When we had just 2 platforms it was fine (the commented platforms), but now that we got a level, he just falls through all the platforms, any help? Yes I used whatdotcolor, we have till thursday to have this done so odds are its staying.

So yeah, help is much appreciated.

Smile Sad BooHoo
code:


const GROUND_HEIGHT := 1
const RUN_SPEED := 10
const JUMP_SPEED := 30
const GRAVITY := 3


var win := Window.Open ("graphics:1000;600;offscreenonly")
var chars : array char of boolean
var PLATFORM_HEIGHT : int
var screenPosition : int := 0
var background : int := Pic.FileNew ("back.jpg")
var stepcounter : int := 0

% player position and velocity
var posx, posy : int
var velx, vely : real
var plat : array 1 .. 25, 1 .. 4 of int
var shot : boolean := false

var stand : int := Pic.FileNew ("stand.bmp")
var walk1 : int := Pic.FileNew ("walk1.bmp")
var walk2 : int := Pic.FileNew ("walk2.bmp")
var walk3 : int := Pic.FileNew ("walk3.bmp")
var jump : int := Pic.FileNew ("jump.bmp")

var shoot1 : int := Pic.FileNew ("shoot1.bmp")
var shoot2 : int := Pic.FileNew ("shoot2.bmp")
var shoot3 : int := Pic.FileNew ("shoot3.bmp")


var walkR1 : int := Pic.Mirror (walk1)
var walkR2 : int := Pic.Mirror (walk2)
var walkR3 : int := Pic.Mirror (walk3)

jump := Sprite.New (jump)
stand := Sprite.New (stand)
walk1 := Sprite.New (walk1)
walk2 := Sprite.New (walk2)
walk3 := Sprite.New (walk3)

walkR1 := Sprite.New (walkR1)
walkR2 := Sprite.New (walkR2)
walkR3 := Sprite.New (walkR3)

shoot1 := Sprite.New (shoot1)
shoot2 := Sprite.New (shoot2)
shoot3 := Sprite.New (shoot3)




Sprite.Show (stand)
Sprite.Hide (stand)


% plat (1, 1) := 200
% plat (1, 2) := 200
% plat (1, 3) := 300
% plat (1, 4) := 220
%
% plat (2, 1) := 400
% plat (2, 2) := 320
% plat (2, 3) := 500
% plat (2, 4) := 340
plat (1, 1) := 69
plat (1, 2) := 88
plat (1, 3) := 900
plat (1, 4) := 100

plat (2, 1) := 0
plat (2, 2) := 190
plat (2, 3) := 52
plat (2, 4) := 170

plat (3, 1) := 72
plat (3, 2) := 241
plat (3, 3) := 148
plat (3, 4) := 232

plat (4, 1) := 0
plat (4, 2) := 319
plat (4, 3) := 63
plat (4, 4) := 326

plat (5, 1) := 81
plat (5, 2) := 430
plat (5, 3) := 318
plat (5, 4) := 440

plat (6, 1) := 454
plat (6, 2) := 406
plat (6, 3) := 597
plat (6, 4) := 400

plat (7, 1) := 746
plat (7, 2) := 410
plat (7, 3) := 959
plat (7, 4) := 402

plat (8, 1) := 1990
plat (8, 2) := 0
plat (8, 3) := 2000
plat (8, 4) := 300

plat (9, 1) := 1012
plat (9, 2) := 309
plat (9, 3) := 1112
plat (9, 4) := 316

plat (10, 1) := 1518
plat (10, 2) := 434
plat (10, 3) := 1167
plat (10, 4) := 422

plat (11, 1) := 1182
plat (11, 2) := 600
plat (11, 3) := 1165
plat (11, 4) := 422

plat (12, 1) := 1592
plat (12, 2) := 58
plat (12, 3) := 1223
plat (12, 4) := 48

plat (13, 1) := 1730
plat (13, 2) := 173
plat (13, 3) := 1526
plat (13, 4) := 161

plat (14, 1) := 1534
plat (14, 2) := 234
plat (14, 3) := 1439
plat (14, 4) := 225

plat (15, 1) := 1502
plat (15, 2) := 332
plat (15, 3) := 1722
plat (15, 4) := 319

plat (16, 1) := 1495
plat (16, 2) := 520
plat (16, 3) := 1857
plat (16, 4) := 528

plat (17, 1) := 1877
plat (17, 2) := 528
plat (17, 3) := 1858
plat (17, 4) := 0

plat (18, 1) := 2074
plat (18, 2) := 118
plat (18, 3) := 2810
plat (18, 4) := 106

plat (19, 1) := 2245
plat (19, 2) := 233
plat (19, 3) := 2620
plat (19, 4) := 245

plat (20, 1) := 2334
plat (20, 2) := 385
plat (20, 3) := 2436
plat (20, 4) := 371

plat (21, 1) := 2096
plat (21, 2) := 454
plat (21, 3) := 2362
plat (21, 4) := 436

plat (22, 1) := 2096
plat (22, 2) := 454
plat (22, 3) := 2110
plat (22, 4) := 600

plat (23, 1) := 2480
plat (23, 2) := 515
plat (23, 3) := 2600
plat (23, 4) := 522

plat (24, 1) := 2788
plat (24, 2) := 490
plat (24, 3) := 2682
plat (24, 4) := 476

plat (25, 1) := 2925
plat (25, 2) := 452
plat (25, 3) := 3000
plat (25, 4) := 408

posx := 20
velx := 0
posy := 400
vely := 0

loop

    Input.KeyDown (chars)
    if chars ('q') then
        exit
    end if

    % to make the player move
    if chars (KEY_LEFT_ARROW) then
        velx := -RUN_SPEED
        stepcounter += RUN_SPEED
        Sprite.Hide (stand)
        Sprite.Hide (walkR1)
        Sprite.Hide (walkR2)
        Sprite.Hide (walkR3)
        if stepcounter = 10 or stepcounter = 20 or stepcounter = 30 or stepcounter = 40 or stepcounter = 50 then
            Sprite.Hide (stand)
            Sprite.Hide (walk3)
            Sprite.SetPosition (walk1, posx, posy + 20, true)
            Sprite.Show (walk1)
            Sprite.Hide (walk2)
        elsif stepcounter = 60 or stepcounter = 70 or stepcounter = 80 or stepcounter = 90 or stepcounter = 100 then
            Sprite.Hide (stand)
            Sprite.SetPosition (walk2, posx, posy + 20, true)
            Sprite.Show (walk2)
            Sprite.Hide (walk1)
        elsif stepcounter = 110 or stepcounter = 120 or stepcounter = 130 or stepcounter = 140 or stepcounter = 150 then
            Sprite.Hide (stand)
            Sprite.SetPosition (walk3, posx, posy + 20, true)
            Sprite.Show (walk3)
            Sprite.Hide (walk1)
            Sprite.Hide (walk2)

        end if
        if stepcounter = 150 or chars (KEY_LEFT_ARROW) = false then
            stepcounter := 0
            Sprite.Hide (stand)
        end if
        if screenPosition <= 0 and posx <= 100 then
            screenPosition += 10
            velx := 0
            plat (1, 1) += 10
            plat (1, 3) += 10

            plat (2, 1) += 10
            plat (2, 3) += 10

            plat (3, 1) += 10
            plat (3, 3) += 10

            plat (4, 1) += 10
            plat (4, 3) += 10

            plat (5, 1) += 10
            plat (5, 3) += 10

            plat (6, 1) += 10
            plat (6, 3) += 10

            plat (7, 1) += 10
            plat (7, 3) += 10

            plat (8, 1) += 10
            plat (8, 3) += 10

            plat (9, 1) += 10
            plat (9, 3) += 10

            plat (10, 1) += 10
            plat (10, 3) += 10

            plat (11, 1) += 10
            plat (11, 3) += 10

            plat (12, 1) += 10
            plat (12, 3) += 10

            plat (13, 1) += 10
            plat (13, 3) += 10

            plat (14, 1) += 10
            plat (14, 3) += 10

            plat (15, 1) += 10
            plat (15, 3) += 10

            plat (16, 1) += 10
            plat (16, 3) += 10

            plat (17, 1) += 10
            plat (17, 3) += 10

            plat (18, 1) += 10
            plat (18, 3) += 10

            plat (19, 1) += 10
            plat (19, 3) += 10

            plat (20, 1) += 10
            plat (20, 3) += 10

            plat (21, 1) += 10
            plat (21, 3) += 10

            plat (22, 1) += 10
            plat (22, 3) += 10

            plat (23, 1) += 10
            plat (23, 3) += 10

            plat (24, 1) += 10
            plat (24, 3) += 10

            plat (25, 1) += 10
            plat (25, 3) += 10
        elsif posx <= 92 then
        end if
    elsif chars (KEY_RIGHT_ARROW) then
        velx := RUN_SPEED
        stepcounter += RUN_SPEED
        Sprite.Hide (stand)
        Sprite.Hide (walk1)
        Sprite.Hide (walk2)
        Sprite.Hide (walk3)
        if stepcounter = 10 or stepcounter = 20 or stepcounter = 30 or stepcounter = 40 or stepcounter = 50 then
            Sprite.Hide (stand)
            Sprite.Hide (walkR3)
            Sprite.SetPosition (walkR1, posx, posy + 20, true)
            Sprite.Show (walkR1)
            Sprite.Hide (walkR2)
        elsif stepcounter = 60 or stepcounter = 70 or stepcounter = 80 or stepcounter = 90 or stepcounter = 100 then
            Sprite.Hide (stand)
            Sprite.SetPosition (walkR2, posx, posy + 20, true)
            Sprite.Show (walkR2)
            Sprite.Hide (walkR1)
        elsif stepcounter = 110 or stepcounter = 120 or stepcounter = 130 or stepcounter = 140 or stepcounter = 150 then
            Sprite.Hide (stand)
            Sprite.SetPosition (walkR3, posx, posy + 20, true)
            Sprite.Show (walkR3)
            Sprite.Hide (walkR1)
            Sprite.Hide (walkR2)
        else
            Sprite.SetPosition (stand, posx, posy + 20, true)
            Sprite.Show (stand)
        end if
        if stepcounter = 150 or chars (KEY_RIGHT_ARROW) = false then
            stepcounter := 0
            Sprite.Hide (stand)
        end if
        if screenPosition >= -2400 and posx >= 500 then
            screenPosition -= 10
            velx := 0
            plat (1, 1) -= 10
            plat (1, 3) -= 10

            plat (2, 1) -= 10
            plat (2, 3) -= 10

            plat (3, 1) -= 10
            plat (3, 3) -= 10

            plat (4, 1) -= 10
            plat (4, 3) -= 10

            plat (5, 1) -= 10
            plat (5, 3) -= 10

            plat (6, 1) -= 10
            plat (6, 3) -= 10

            plat (7, 1) -= 10
            plat (7, 3) -= 10

            plat (8, 1) -= 10
            plat (8, 3) -= 10

            plat (9, 1) -= 10
            plat (9, 3) -= 10

            plat (10, 1) -= 10
            plat (10, 3) -= 10

            plat (11, 1) -= 10
            plat (11, 3) -= 10

            plat (12, 1) -= 10
            plat (12, 3) -= 10

            plat (13, 1) -= 10
            plat (13, 3) -= 10

            plat (14, 1) -= 10
            plat (14, 3) -= 10

            plat (15, 1) -= 10
            plat (15, 3) -= 10

            plat (16, 1) -= 10
            plat (16, 3) -= 10

            plat (17, 1) -= 10
            plat (17, 3) -= 10

            plat (18, 1) -= 10
            plat (18, 3) -= 10

            plat (19, 1) -= 10
            plat (19, 3) -= 10

            plat (20, 1) -= 10
            plat (20, 3) -= 10

            plat (21, 1) -= 10
            plat (21, 3) -= 10

            plat (22, 1) -= 10
            plat (22, 3) -= 10

            plat (23, 1) -= 10
            plat (23, 3) -= 10

            plat (24, 1) -= 10
            plat (24, 3) -= 10

            plat (25, 1) -= 10
            plat (25, 3) -= 10
        elsif posx >= 632 then

        end if
    elsif chars (KEY_ENTER) then
        Sprite.Hide (stand)
        Sprite.Hide (walk1)
        Sprite.Hide (walk2)
        Sprite.Hide (walk3)
        Sprite.Hide (walkR1)
        Sprite.Hide (walkR2)
        Sprite.Hide (walkR3)


        Sprite.SetPosition (shoot1, posx, posy + 20, true)
        Sprite.Hide (shoot3)
        Sprite.Show (shoot1)
        delay (100)
        Sprite.SetPosition (shoot2, posx, posy + 20, true)
        Sprite.Hide (shoot1)
        Sprite.Show (shoot2)
        delay (100)
        Sprite.SetPosition (shoot3, posx, posy + 20, true)
        Sprite.Hide (shoot2)
        Sprite.Show (shoot3)
        delay (100)
    else
        velx := 0
    end if

    Pic.Draw (background, screenPosition, 0, picCopy)
    Sprite.Show (stand)
    % drawfillbox (plat (1, 1), plat (1, 2), plat (1, 3), plat (1, 4), 3)
    % drawfillbox (plat (2, 1), plat (2, 2), plat (2, 3), plat (2, 4), 3)
    drawfillbox (plat (1, 1), plat (1, 2), plat (1, 3), plat (1, 4), 3)
    drawfillbox (plat (2, 1), plat (2, 2), plat (2, 3), plat (2, 4), 3)
    drawfillbox (plat (3, 1), plat (3, 2), plat (3, 3), plat (3, 4), 3)
    drawfillbox (plat (4, 1), plat (4, 2), plat (4, 3), plat (4, 4), 3)
    drawfillbox (plat (5, 1), plat (5, 2), plat (5, 3), plat (5, 4), 3)
    drawfillbox (plat (6, 1), plat (6, 2), plat (6, 3), plat (6, 4), 3)
    drawfillbox (plat (7, 1), plat (7, 2), plat (7, 3), plat (7, 4), 3)
    drawfillbox (plat (8, 1), plat (8, 2), plat (8, 3), plat (8, 4), 3)
    drawfillbox (plat (9, 1), plat (9, 2), plat (9, 3), plat (9, 4), 3)
    drawfillbox (plat (10, 1), plat (10, 2), plat (10, 3), plat (10, 4), 3)
    drawfillbox (plat (11, 1), plat (11, 2), plat (11, 3), plat (11, 4), 3)
    drawfillbox (plat (12, 1), plat (12, 2), plat (12, 3), plat (12, 4), 3)
    drawfillbox (plat (13, 1), plat (13, 2), plat (13, 3), plat (13, 4), 3)
    drawfillbox (plat (14, 1), plat (14, 2), plat (14, 3), plat (14, 4), 3)
    drawfillbox (plat (15, 1), plat (15, 2), plat (15, 3), plat (15, 4), 3)
    drawfillbox (plat (16, 1), plat (16, 2), plat (16, 3), plat (16, 4), 3)
    drawfillbox (plat (17, 1), plat (17, 2), plat (17, 3), plat (17, 4), 3)
    drawfillbox (plat (18, 1), plat (18, 2), plat (18, 3), plat (18, 4), 3)
    drawfillbox (plat (19, 1), plat (19, 2), plat (19, 3), plat (19, 4), 3)
    drawfillbox (plat (20, 1), plat (20, 2), plat (20, 3), plat (20, 4), 3)
    drawfillbox (plat (21, 1), plat (21, 2), plat (21, 3), plat (21, 4), 3)
    drawfillbox (plat (22, 1), plat (22, 2), plat (22, 3), plat (22, 4), 3)
    drawfillbox (plat (23, 1), plat (23, 2), plat (23, 3), plat (23, 4), 3)
    drawfillbox (plat (24, 1), plat (24, 2), plat (24, 3), plat (24, 4), 3)
    drawfillbox (plat (25, 1), plat (25, 2), plat (25, 3), plat (25, 4), 3)

    drawline (0, GROUND_HEIGHT, maxx, GROUND_HEIGHT, blue)
    Sprite.SetPosition (stand, posx, posy, false)

    % remember, in order to jump you MUST be on the ground when pressing UP
    if chars (KEY_UP_ARROW) and posy = GROUND_HEIGHT or chars (KEY_UP_ARROW) and whatdotcolor (posx, posy) = 3 then
        vely := JUMP_SPEED
        Sprite.Hide (stand)
    end if

    % subtract your "gravity" constant from the velocity EACH frame
    vely -= GRAVITY
    posx += round (velx)
    posy += round (vely)


    % simple "collision" check. just makes sure the player stays above ground
    if posy <= GROUND_HEIGHT then
        posy := GROUND_HEIGHT
        vely := 0
    end if

    if posy >= plat (1, 2) and posy <= plat (1, 4) and posx > plat (1, 1) and posx < plat (1, 3) then
        posy := plat (1, 4)
        vely := 0
    elsif posy >= plat (2, 2) and posy <= plat (2, 4) and posx > plat (2, 1) and posx < plat (2, 3) then
        posy := plat (2, 4)
        vely := 0
    elsif posy >= plat (3, 2) and posy <= plat (3, 4) and posx > plat (3, 1) and posx < plat (3, 3) then
        posy := plat (3, 4)
        vely := 0
    elsif posy >= plat (4, 2) and posy <= plat (4, 4) and posx > plat (4, 1) and posx < plat (4, 3) then
        posy := plat (4, 4)
        vely := 0
    elsif posy >= plat (5, 2) and posy <= plat (5, 4) and posx > plat (5, 1) and posx < plat (5, 3) then
        posy := plat (5, 4)
        vely := 0
    elsif posy >= plat (6, 2) and posy <= plat (6, 4) and posx > plat (6, 1) and posx < plat (6, 3) then
        posy := plat (6, 4)
        vely := 0
    elsif posy >= plat (7, 2) and posy <= plat (7, 4) and posx > plat (7, 1) and posx < plat (7, 3) then
        posy := plat (7, 4)
        vely := 0
    elsif posy >= plat (8, 2) and posy <= plat (8, 4) and posx > plat (8, 1) and posx < plat (8, 3) then
        posy := plat (8, 4)
        vely := 0
    elsif posy >= plat (9, 2) and posy <= plat (9, 4) and posx > plat (9, 1) and posx < plat (9, 3) then
        posy := plat (9, 4)
        vely := 0
    elsif posy >= plat (10, 2) and posy <= plat (10, 4) and posx > plat (10, 1) and posx < plat (10, 3) then
        posy := plat (10, 4)
        vely := 0
    elsif posy >= plat (11, 2) and posy <= plat (11, 4) and posx > plat (11, 1) and posx < plat (11, 3) then
        posy := plat (11, 4)
        vely := 0
    elsif posy >= plat (12, 2) and posy <= plat (12, 4) and posx > plat (12, 1) and posx < plat (12, 3) then
        posy := plat (12, 4)
        vely := 0
    elsif posy >= plat (13, 2) and posy <= plat (13, 4) and posx > plat (13, 1) and posx < plat (13, 3) then
        posy := plat (13, 4)
        vely := 0
    elsif posy >= plat (14, 2) and posy <= plat (14, 4) and posx > plat (14, 1) and posx < plat (14, 3) then
        posy := plat (14, 4)
        vely := 0
    elsif posy >= plat (15, 2) and posy <= plat (15, 4) and posx > plat (15, 1) and posx < plat (15, 3) then
        posy := plat (15, 4)
        vely := 0
    elsif posy >= plat (16, 2) and posy <= plat (16, 4) and posx > plat (16, 1) and posx < plat (16, 3) then
        posy := plat (16, 4)
        vely := 0
    elsif posy >= plat (17, 2) and posy <= plat (17, 4) and posx > plat (17, 1) and posx < plat (17, 3) then
        posy := plat (17, 4)
        vely := 0
    elsif posy >= plat (18, 2) and posy <= plat (18, 4) and posx > plat (18, 1) and posx < plat (18, 3) then
        posy := plat (18, 4)
        vely := 0
    elsif posy >= plat (19, 2) and posy <= plat (19, 4) and posx > plat (19, 1) and posx < plat (19, 3) then
        posy := plat (19, 4)
        vely := 0
    elsif posy >= plat (20, 2) and posy <= plat (20, 4) and posx > plat (20, 1) and posx < plat (20, 3) then
        posy := plat (20, 4)
        vely := 0
    elsif posy >= plat (21, 2) and posy <= plat (21, 4) and posx > plat (21, 1) and posx < plat (21, 3) then
        posy := plat (21, 4)
        vely := 0
    elsif posy >= plat (22, 2) and posy <= plat (22, 4) and posx > plat (22, 1) and posx < plat (22, 3) then
        posy := plat (22, 4)
        vely := 0
    elsif posy >= plat (23, 2) and posy <= plat (23, 4) and posx > plat (23, 1) and posx < plat (23, 3) then
        posy := plat (23, 4)
        vely := 0
    elsif posy >= plat (24, 2) and posy <= plat (24, 4) and posx > plat (24, 1) and posx < plat (24, 3) then
        posy := plat (24, 4)
        vely := 0
    elsif posy >= plat (25, 2) and posy <= plat (25, 4) and posx > plat (25, 1) and posx < plat (25, 3) then
        posy := plat (25, 4)
        vely := 0
    end if


    put posy
    put stepcounter



    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    View.Update
    delay (25)
    cls
end loop

Window.Close (win)
Sponsor
Sponsor
Sponsor
sponsor
SNIPERDUDE




PostPosted: Tue Jan 19, 2010 11:18 am   Post subject: RE:Oh collision, thou art a villian so foul

If you use a colour-based collision system, it could make it not only easier, but more universal (easy to add new maps) and much shorter on code.

How this system works is you would first draw the platforms an any given colour (black is typical) on a white background. You could even make the map on paint and just load it as your map. The next step would be to use whatdotcolour (you can find a tutorial in the Turing Walkthrough) for collision detection. Then when you have finished doing all of your math and collision detection, draw on top a graphical version of the same map (make sure you use Pic.Blend!) so it doesn't have to look like c**p.

This way, you can make complex maps, without having to plot every point possible.
Good luck with your programme!
rcbhs




PostPosted: Wed Jan 20, 2010 8:43 am   Post subject: Re: RE:Oh collision, thou art a villian so foul

SNIPERDUDE @ Tue Jan 19, 2010 11:18 am wrote:
If you use a colour-based collision system, it could make it not only easier, but more universal (easy to add new maps) and much shorter on code.

How this system works is you would first draw the platforms an any given colour (black is typical) on a white background. You could even make the map on paint and just load it as your map. The next step would be to use whatdotcolour (you can find a tutorial in the ) for collision detection. Then when you have finished doing all of your math and collision detection, draw on top a graphical version of the same map (make sure you use Pic.Blend!) so it doesn't have to look like c**p.

This way, you can make complex maps, without having to plot every point possible.
Good luck with your programme!


Thats exactly what we are using for collision, however only whatdotcolor didn't work so we have a mix of whatdotcolor and actual plotted points. Problem is it is not detecting the color.
SNIPERDUDE




PostPosted: Wed Jan 20, 2010 12:52 pm   Post subject: RE:Oh collision, thou art a villian so foul

Which is why you would use 2 different layers, the first layer you draw for the collision system (which would just be a black&white version), then whence the collision detection has been done you'd draw on the graphical layer.

so:

1) Draw under layer
2) do all the collision detection
3) draw graphical layer
4) View.Update
Insectoid




PostPosted: Wed Jan 20, 2010 1:29 pm   Post subject: RE:Oh collision, thou art a villian so foul

Damn...I never thought of that before, SNIPERDUDE. If I ever make another platformer (unlikely as that is), I'll definitely use that strategy.
SNIPERDUDE




PostPosted: Wed Jan 20, 2010 11:48 pm   Post subject: RE:Oh collision, thou art a villian so foul

The technique also works for tiled-based games. Just have a record of which tiles are what type (walls, floor, cliff, etc) and draw a solid-colour tile down before the collision detection (and have the actual tile drawn down after). You could even have different coloured base tiles for different applications (ex:white tile is floor, black is wall, red is trap/cliff edge, yellow is a pit (lower altitude)), the possibilities are extensive really.
andrew.




PostPosted: Thu Jan 21, 2010 8:22 pm   Post subject: RE:Oh collision, thou art a villian so foul

I never thought of that either. Thanks for the tip. Wink
SNIPERDUDE




PostPosted: Thu Jan 21, 2010 10:00 pm   Post subject: RE:Oh collision, thou art a villian so foul

No problem, I've learned hundreds of tricks throughout the years. It's always fun learning new techniques, tips, styles, etc, which is why I'm always borrowing a couple (at least) books from my school's (college) library. eBooks are always good too for those who don't have access to an extensive library.
Sponsor
Sponsor
Sponsor
sponsor
Euphoracle




PostPosted: Thu Jan 21, 2010 10:05 pm   Post subject: RE:Oh collision, thou art a villian so foul

The technique is called a 1-bit collision mask (but you can bump it up if you don't want to do multiple passes) and it is very effective for 2D games, specifically side-scrollers.
SNIPERDUDE




PostPosted: Thu Jan 21, 2010 10:14 pm   Post subject: RE:Oh collision, thou art a villian so foul

Agreed, I used to use that technique for my ISU's in high school. Very effective indeed.
USEC_OFFICER




PostPosted: Mon Feb 08, 2010 8:33 pm   Post subject: RE:Oh collision, thou art a villian so foul

Agreed, but it has many other uses, like for AI and blah blah blah just posting to get 25 so I can give someone karma, ya da ya da.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: