
-----------------------------------
Token
Fri May 06, 2005 3:49 pm

My helicopter game
-----------------------------------
hey evryone, check out my helicopter game, i'm working on it for my FP and i was wondering what else i should add to it, so check it out and tell me what you think.

-----------------------------------
jamonathin
Fri May 06, 2005 8:41 pm


-----------------------------------
Your program seems a little unreactive, Im on a new computer so I dont think its that.  I got through one time and it semed not bad.  You should just explain to the user that they use the keyboard not the mouse.

-----------------------------------
Cervantes
Sat May 07, 2005 7:25 am


-----------------------------------
Yes, the menu is quite unresponsive.  I suspect this is because you've got a large delay in your menu loop.  Second, you should adjust the game such that when you click, the helicopter increases his y velocity.  At all times, the gravity is pulling the helicopter down.  It would make the game a lot nicer and more realistic.

EDIT: like this

colourback (black)
cls

var heli :
    record
        x, y, vx, vy : real
        yAccel : real
        r : int %radius
        c : int %colour
    end record

heli.x := 10
heli.y := maxy / 2
heli.vx := 0.5
heli.vy := 0
heli.yAccel := 0.2
heli.r := 5
heli.c := 0

const gravity := 0.1

var mx, my, btn : int

loop
    mousewhere (mx, my, btn)
    if btn = 1 then
        heli.vy += heli.yAccel
    end if
    heli.vy -= gravity
    heli.x += heli.vx
    heli.y += heli.vy

    drawfilloval (round (heli.x), round (heli.y), heli.r, heli.r, heli.c)
    delay (20)
    exit when heli.x > maxx
end loop


-----------------------------------
Token
Sat May 07, 2005 8:18 pm


-----------------------------------
yes, my menu is a little slow, its because my computer at home is fast and the one at school is slow lol so when i use it here it jumps too fast and at school really slow, so i'll have to play with that to find a happy medium, or maybe make it so that there are arrows on the side of the menu that u click on... ill think about it. ne ways yes i realise the real helecopter game uses the mouse clicking thing, I just did it that way for when i was testing and never really changed it, my previous game worked on clicking and releasing but i didnt use the pic commands to redraw it so it was really slow, i think i'll just steal that code from my previous one and then repost when i get a chance, thanks for all the feedback guys and keep it comin  :D

-----------------------------------
Cervantes
Sat May 07, 2005 9:29 pm


-----------------------------------
The menu thing is not a question of finding a happy medium value for your delay.  Rather, it's a matter of coding such that you don't have delays at all.  You could do this in two ways: first, use getch().  Note that this is simple, but prevents you from having anything else happening while the menu is active.  Second, you have a nested loop that exists when a certain time has passed.  Inside this nested loop, you check for input.  Get it?  (Note that second method is entirely my idea and may not be the best way to do it.  It does, however, work.  :))
