
-----------------------------------
magicman
Wed Jun 09, 2004 12:40 pm

Real and int
-----------------------------------
How can I make this prg work. I have a real int and a int in the same Pic.Draw. Help


View.Set ("offscreenonly")
var x, y : int
x := 0
y := 0
var keys : array char of boolean
var jump := false %boolean. since it's declared as false turing knows its boolean
var x1, y1, vy : real %vy = velocity in the y plane.  aka, the upwards velocity of the player.
x1 := 0
y1 := 0
const gravity := 0.1
var size := 35
var enemy : int := Pic.FileNew ("enemy1.bmp")
var player : int := Pic.FileNew ("player.jpg")
drawline (0, 4, maxx, 4, 17)
loop
    cls
    drawline (0, 4, maxx, 4, 17)
    Input.KeyDown (keys)
    if keys (KEY_UP_ARROW) and not jump then %"and not jump" is the same as "and jump = false"
        jump := true
        vy := 4
    end if
    if jump then %"if jump then" is the same as "if jump = true then"
        y1 += vy % same as y := y + vy
        vy -= gravity % same as vy := vy - gravity
        if y1 