Computer Science Canada

Interesting effect

Author:  Paul [ Mon Dec 13, 2004 11:29 am ]
Post subject:  Interesting effect

From my projectile motion code
code:

setscreen ("graphics: max;max")
const grav:= 9.8
var speed, angle, Vhor, Vvert: real
var x, y: real
for b: 0..90 by 10
for c: 0..500 by 5
speed:=c
angle:=b
Vhor:= speed * (cosd (angle))
Vvert:= speed*(sind(angle))
    for a : 1 .. 1000000
  x := a / 100 * Vhor
        y := (Vvert * (a / 100) - 0.5 * grav * (a / 100) ** 2)
       
        drawdot (round (x ), round (y), black)
        exit when y <= 0
end for

end for

end for


edit: later
code:


setscreen ("graphics: max;max")
const grav:= 9.8
var speed, angle, Vhor, Vvert: real
var x, y: real
for b: 0..90 by 10
for c: 0..500 by 5
speed:=c
angle:=b
Vhor:= speed * (cosd (angle))
Vvert:= speed*(sind(angle))
    for a : 1 .. 1000000
  x := a / 100 * Vhor
        y := (Vvert * (a / 100) - 0.5 * grav * (a / 100) ** 2)
       
        drawdot (round (x ), round (y), black)
        drawdot (round(maxx-x), round(y),black)
        exit when y <= 0
end for

end for

end for

Author:  zomg [ Mon Dec 13, 2004 11:38 am ]
Post subject: 

interesting effect indeed

looks kewl when the screen is full
nice job

Author:  cool dude [ Mon Dec 13, 2004 5:59 pm ]
Post subject: 

pretty cool! even though i remember seeing something similar like that on this site before not accusing u of anything though. u should take out that delay, and make it fullscreen because it looks awsome that way.

Author:  Paul [ Mon Dec 13, 2004 6:09 pm ]
Post subject: 

check it.
code:

setscreen ("graphics: max;max")
drawfill (10,10,black,black)
const grav:= 9.8
var col: int
var speed, angle, Vhor, Vvert: real
var x, y: real
for b: 0..90 by 10
randint (col, 100, 150)
for c: 0..500 by 5
speed:=c
angle:=b
Vhor:= speed * (cosd (angle))
Vvert:= speed*(sind(angle))
    for a : 1 .. 1000000
  x := a / 100 * Vhor
        y := (Vvert * (a / 100) - 0.5 * grav * (a / 100) ** 2)
       
        drawdot (round (x ), round (y), col)
        drawdot (round(maxx-x), round(y),col)
        exit when y <= 0
end for

end for

end for



Author:  Kelsey [ Mon Dec 13, 2004 9:46 pm ]
Post subject: 

Very cool Smile

Author:  BPhelmet [ Wed Dec 15, 2004 9:36 pm ]
Post subject: 

interesting indeed
nice

Author:  m&m [ Thu Dec 16, 2004 11:38 am ]
Post subject: 

kinda slow but it looks kewl

Author:  Delos [ Thu Dec 16, 2004 5:39 pm ]
Post subject: 

Slow?

Try this:

code:

setscreen ("graphics:max;max;offscreenonly")
colourback (7)
drawfill (10, 10, black, black)
const grav := 9.8
var col : int
var speed, angle, Vhor, Vvert : real
var x, y : real
for b : 0 .. 90 by 10
    randint (col, 100, 150)
    for c : 0 .. 500 by 5
        speed := c
        angle := b
        Vhor := speed * (cosd (angle))
        Vvert := speed * (sind (angle))
        for a : 1 .. 1000000
            x := a / 100 * Vhor
            y := (Vvert * (a / 100) - 0.5 * grav * (a / 100) ** 2)

            drawfilloval (round (x), round (y), 3, 3, col)
            drawfilloval (round (maxx - x), round (y), 3, 3, col)
            exit when y <= 0
        end for
        View.Update
        cls
    end for
end for


Wink

Author:  Paul [ Thu Dec 16, 2004 7:37 pm ]
Post subject: 

Whoa, slow down there speed demon. Surprised


: