Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need Help with Rocket Game (Bomb Animation)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ZeroPaladn




PostPosted: Fri Jun 10, 2005 9:05 am   Post subject: Need Help with Rocket Game (Bomb Animation)

Im looking for someone with the know-how to help me fix a prob with my rocket program. You have two weapons, a laser and a bomb. the laser seems to be working fine but when i shoot the bomb it just appears over the rocket. heres the code...

code:

setscreen ("graphics:max,max,offscreenonly")

var x : int := 350
var y : int := 225
var bomby : int := y + 50
var picID : int
var chars : array char of boolean

loop
    cls
    drawfilloval (x - 5, y - 40, 5, 20, 43)
    drawfillbox (x - 10, y - 30, x - 20, y - 40, black)
    drawfillbox (x, y - 30, x + 10, y - 40, black)
    drawfilloval (x - 5, y, 5, 5, black)
    drawfillbox (x, y, x - 10, y - 40, black)
    picID := Pic.New (x, y, x, y)
    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
    if chars (KEY_CTRL) then
        drawfillbox (x - 4, y + 10, x - 6, y + 1000, 43)
    end if
    %bomb animation
    if chars (KEY_ALT) then
        for i : 1 .. 800
        cls
        drawfilloval (x, i, 100, 20, red)
        end for
    end if
    %end bomb animation
    Pic.Draw (picID, x, y, picCopy)
    Pic.Free (picID)
    View.Update
end loop


I just started on the game so i just got the sprite made. Im getting ready to make it so its kinda like "space invaders".
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Fri Jun 10, 2005 9:21 am   Post subject: (No subject)

Quote:

if chars (KEY_ALT) then
for i : 1 .. 800
cls
drawfilloval (x, i, 100, 20, red)
end for
end if


Add a 'View.Update' below the drawfilloval(). Now you have a new problem to contend with!
My suggestion is to create procedues (one or a series) to handle all your drawing, which can be called during your main loop.
ZeroPaladn




PostPosted: Fri Jun 10, 2005 9:28 am   Post subject: (No subject)

ive tried using procedures but ive allways f***ed them up, every time, no failiure. i guess ill just have to try again. anyways thanks for the help.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: