
-----------------------------------
ZeroPaladn
Thu Jun 09, 2005 9:29 am

MY FIRST PROGRAM
-----------------------------------
this is my first ever program that I made, by myself. I know its just compared to everything else on this site but i hope you guys can give me kudos just for doing htis.

-----------------------------------
Aziz
Thu Jun 09, 2005 12:40 pm


-----------------------------------
That's pretty good, especially for a first program. But, you don't need an Input.hasch (btw, you can just call hasch instead of Input.hasch), Input.KeyDown works by itself (it probably uses hasch itself). And you can change

y := y + 10

to

y += 10

or even better,

y += 1

which is smoother

+= is incremental

-= is decremental

And, if you make each separate key press check a different if statment, you can get diagonal movement :) Here's the code I changed around a bit. Pretty sweet, though. My first program was a simple art picture. And then a "Hi, my name is" :P

setscreen ("graphics:640,480,offscreenonly")

var x : int := 300
var y : int := 200
var chars : array char of boolean

loop
    cls
    drawfilloval (x, y, 20, 20, 43)
    Input.KeyDown (chars)
    if chars (KEY_UP_ARROW) then
        y += 1
    end if
    if chars (KEY_DOWN_ARROW) then
        y -= 1
    end if
    if chars (KEY_LEFT_ARROW) then
        x -= 1
    end if
    if chars (KEY_RIGHT_ARROW) then
        x += 1
    end if
    View.Update
end loop


-----------------------------------
ZeroPaladn
Thu Jun 09, 2005 12:43 pm


-----------------------------------
thanks guy, er girl, whatever. ive allways had trouble with truing, i could never get it right. thanks for cleaning my code for me.

EDIT
i have also had trouble with spelling :) this program is the beta for my rocket game. expect it sometime at the end of the month.
