
-----------------------------------
snaz
Tue May 18, 2004 8:35 pm

need help in disapearing the rock from screen
-----------------------------------
Hi guys, this is my first time that I am posting here. I am making the asteroid game and I am almost done. I need help to disappear the rock from screen when I shoot with my gun, and also how can I do this by chance if rock hit my plane, then the plan crash and after2 second, new ship appear. Some one plz help cus this is my first and last assignment in Turing.  

here are the codes of my game

View.Set ("graphics:800;600,offscreenonly")

var shipUpper : int := Pic.FileNew ("gun.jpg")
var bulletUpper : int := Pic.FileNew ("bullet.jpg")
var rock : int := Pic.FileNew ("rock.jpg")
Pic.SetTransparentColour (rock, black)
var shipDown : int := Pic.Rotate (shipUpper, 180, -1, -1)      % Rotate for down arrow
var shipLeft : int := Pic.Rotate (shipUpper, 90, -1, -1)       % Rotate for left arrow
var shipRight : int := Pic.Rotate (shipUpper, 270, -1, -1)     % Rotate for right arrow
var bulletDown : int := Pic.Rotate (bulletUpper, 180, -1, -1)
var bulletLeft : int := Pic.Rotate (bulletUpper, 90, -1, -1)
var bulletRight : int := Pic.Rotate (bulletUpper, 270, -1, -1)

var x1, y1, x2, x3, y4, bulletX, bulletY, score, life, rockX, rockY : int := 0
var keys : array char of boolean % they key currently being pressed
var KEY_SPACEBAR : char := chr (32)
var UP_ARROW : char := chr (200)
var LEFT_ARROW : char := chr (203)
var RIGHT_ARROW : char := chr (205)
var DOWN_ARROW : char := chr (208)

life := 20
rockX := 20
rockY := 700

process rockDropping
    loop
        Pic.Draw (rock, rockX, rockY, picXor)
        View.Update
        Pic.Draw (rock, rockX, rockY, picXor)
        rockY := rockY - 10
        if rockY = 300 then
        cls
        Pic.Draw (shipDown, x2 + x3, y4 + y1, picMerge)
        y1 := y1 - 10
    elsif y4 + y1 = 500 then
        cls
        Pic.Draw (shipLeft, x2 + x3, y1 + y4, picMerge)
        x3 := x3 - 10
    end if

    locate (33, 87)
    color (white)
    put score, " : Score"

    locate (35, 87)
    color (white)
    put life, " : Life"

        View.Update
   

end loop

-----------------------------------
Delos
Tue May 18, 2004 8:53 pm


-----------------------------------
Ok...

1)  Use [code] tags.
2)  Nice code...but we don't have the pics you speak of in it.  Zip everything together then post that.
3)  Don't post all your code, just your problem areas.
4)  Don't use processes for a programme this simple.
5)  Please don't use processes.
6)  Many people here have computers several hundred times faster and better than those that you use at your school/home...thus being you will most likely need Time.Delay()s in your prog...

Fix and then repost...you'll get better answers quicker.

-----------------------------------
snaz
Tue May 18, 2004 10:09 pm

attach all the pics with codes
-----------------------------------
i attach all the pics and i already posted the game codes, one more question where can i put my background in my program thanks for helping

-----------------------------------
snaz
Wed May 19, 2004 9:27 pm

y is no one giving the response
-----------------------------------
hi guys i posted my problem why is some one is not helping me, plz someone help me, i am not posting my problen cus i alreadt posted adn also i posted all the pic

-----------------------------------
LiquidDragon
Thu May 20, 2004 2:39 pm


-----------------------------------
your still missing pictures

-----------------------------------
snaz
Thu May 20, 2004 5:23 pm

posted my pics
-----------------------------------
hi, i posted my pic, plz some one hlp me

-----------------------------------
snaz
Thu May 20, 2004 5:37 pm

POsted correct pics
-----------------------------------
hi, sorry my bad i didn't attach the pics , but this time i did. i ma not posting my problem again cus i already posted in,. plz help me

-----------------------------------
snaz
Thu May 20, 2004 5:48 pm


-----------------------------------
hi, this time i posted all my pic of my game and  i already posted the codes and my problem, plz help me

-----------------------------------
snaz
Thu May 20, 2004 5:51 pm


-----------------------------------
hi, this time i posted all my pic of my game and i already posted the codes and my problem, plz help me

-----------------------------------
snaz
Thu May 20, 2004 5:55 pm


-----------------------------------
sorry, i tried 3 times but i cna't post the pics i don't know y. just write down the codes adn i already posted the codes and my problem, plz help me

-----------------------------------
snaz
Thu May 20, 2004 5:56 pm


-----------------------------------
if u cna't help me with out the pics then click http://www.compsci.ca/v2/viewtopic.php?p=48523#48523
you will get pics

-----------------------------------
snaz
Fri May 21, 2004 3:55 pm

PLease some one help me
-----------------------------------
i posted my prrblem two days ago but no one is helping me, pls some one hlep adn i am not posting my problem cus i already posted it
