
-----------------------------------
NeutronX
Fri Nov 09, 2007 3:34 pm

I cant move while I shoot!
-----------------------------------
I want to be able to drive my race cars and also have the player 1 car be able to shoot without pausing the rest of the game. This is a racing game. Can someone please edit this code so that I can do that? THX!


import GUI

setscreen ("graphics:1080;400,nobuttonbar")


drawfill (1, 1, 9, 9)


process engine
    loop
        Music.PlayFile ("lancia_integrale.wav")
    end loop
end engine

procedure start
    locate (1, 1)
    cls
    drawfill (100, 100, red, 7)
    locatexy (430, 200)
    colourback (red)
    put "RACE STARTING IN 5 SECONDS"
    delay (100)
    cls

    drawfillbox (0, 0, 1080, 20, 21)
    drawfillbox (0, 400, 640, 20, 100)
    var pic7 : int := Pic.FileNew ("cloud.bmp")
    Pic.Draw (pic7, 0, 18, 0)
    var x : int := 120
    var y : int := 35
    var x1 : int := 50
    var y1 : int := 35
    var centered : boolean := false
    var chars : array char of boolean
 
  

    var pic1 : int := Pic.FileNew ("coolcar.bmp")
    var sprite1 : int := Sprite.New (pic1)

    var pic6 : int := Pic.FileNew ("orb1.bmp")
    Pic.Draw (pic6, 500, 20, 0)

    var pic5 : int := Pic.FileNew ("coolcar2.bmp")
    var sprite2 : int := Sprite.New (pic5)

    var mypic7 : int := Pic.FileNew ("rocket.bmp")
    var mypic8 : int := Pic.FileNew ("speed.bmp")
    var pic9 : int := Pic.FileNew ("bullet.bmp")
    var sprite3 : int := Sprite.New (pic9)


    var gravity : int := -1

    var vx, vy : int
    vy := 0
    vx := 0

    var vx1, vy1 : int
    vy1 := 0
    vx1 := 0

    var jumping : boolean := false
    var jumping1 : boolean := false
    
    var special:boolean:=false
    var special1:boolean:=false
    
    
var bullety : int 
var bulletx : int 

bullety := 200 
var bullet : int 

var Shooting : boolean := false 

    fork engine

    loop
        Sprite.Show (sprite1)
        Sprite.SetPosition (sprite1, x, y, true)

        delay (20)


        Sprite.Show (sprite1)
        Sprite.SetPosition (sprite1, x, y, true)

        Input.KeyDown (chars)
        if x >= 1050 then
            chars (KEY_UP_ARROW) := false
        end if

        if chars (KEY_UP_ARROW) and not jumping then
            jumping := true
            vy := 10
        end if

        if jumping then
            x += 1
            y += vy
            vy += gravity
            delay (7)
        end if

        if y  500 and x < 510 then
            locatexy (56, 350)
            colourback (white)
            put "Player 1 has their SPECIAL!!!!!!" ..
            Pic.Draw (mypic7, 2, 315, 0)
        end if
        
        if x > 900 and x= 1050 then
            chars ('w') := false
        end if

        if chars ('w') and not jumping1 then
            jumping1 := true
            vy1 := 10
        end if

        if jumping1 then
            x1 += 1
            y1 += vy1
            vy1 += gravity
            delay (7)
        end if

        if y1 = 500 and x1 500 and x1 < 510 then
            locatexy (56, 280)
            colourback (white)
            put "Player 2 has their SPECIAL!!!!!!" ..
            Pic.Draw (mypic8, 2, 250, 0)
        end if
        
        if x1 > 900 and x1500 and x