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

Username:   Password: 
 RegisterRegister   
 bomberman help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mimi




PostPosted: Sat Jan 03, 2004 7:14 pm   Post subject: (No subject)

:( i need mad help....; I am making a game that is called bomberman... and i need help... when i move the "player 1" the bombs under it is erased and i need the bombs 2 show after the player has been moved... but instead it shows the player...
please i need mad help :cry:
Sponsor
Sponsor
Sponsor
sponsor
DanShadow




PostPosted: Sat Jan 03, 2004 8:18 pm   Post subject: (No subject)

Mimi, I have a solution to your problem! The "Almighty Array"!

*ominous trumpets sound in the distance*

hmm...try this:
code:

var playerx, playery : int
playerx := 20
playery := 380
var key : string (1) := ""
var num, counter : int := 0
var bombx, bomby : array 1 .. 200 of int
for i : 1 .. 200
    bombx (i) := -20
    bomby (i) := -20
end for

loop
    setscreen ("offscreenonly")
    View.Update
    delay (5)
    num := num + 1
    Draw.FillBox (0, 0, maxx, maxy, 255)
    Draw.FillBox (playerx - 20, playery - 20, playerx + 20, playery + 20, 1)
    if hasch then
        getch (key)
    end if
    if key = (KEY_RIGHT_ARROW) and playerx < maxx - 10 then
        playerx := playerx + 6
    elsif key = (KEY_LEFT_ARROW) and playerx > 10 then
        playerx := playerx - 6
    end if
    for i : 1 .. 200
        if bomby (i) < 0 then
            bombx (i) := -20
            bomby (i) := -20
        end if
        if bombx (i) not= -20 and bomby (i) not= -20 then
            Draw.FillOval (bombx (i), bomby (i), 15, 15, 12)
            bomby (i) := bomby (i) - 18
        end if
    end for
    if counter >= 5 then
        if bombx (num) = -20 and bomby (num) = -20 then
            bombx (num) := playerx
            bomby (num) := playery - 15
            counter := 0
        end if
    end if
    counter := counter + 1
    if num = 199 then
        num := 0
    end if
end loop

Oh and sorry for giving away the answer....but Mimi, I purposely didnt put in comments. This way you can examine the code, figure how everything works, and use it if you wish in your game. Oh, if you have any questions, or get confused in the code, just Private Message me...because chances are I probably wont see your message if you post it here.
Enjoy
mimi




PostPosted: Sun Jan 04, 2004 2:35 pm   Post subject: (No subject)

mimi wrote:
Sad i need mad help....; I am making a game that is called bomberman... and i need help... when i move the "player 1" the bombs under it is erased and i need the bombs 2 show after the player has been moved... but instead it shows the player...
please i need mad help Crying or Very sad
mimi




PostPosted: Sun Jan 04, 2004 3:52 pm   Post subject: (No subject)

i was wondering if anyone knows how 2 use a Pic>Merge????
if soo please let me know... i wna tto know the parameters that are needed 2 use it... Confused
DanShadow




PostPosted: Sun Jan 04, 2004 4:21 pm   Post subject: (No subject)

I do... use this .
code:

var bomberman:=Pic.New("bomberman.bmp")
Draw.Pic(bomberman,20,50,picMerge)
mimi




PostPosted: Sun Jan 04, 2004 10:55 pm   Post subject: (No subject)

DanShadow....
Smile Thank you very much
... it was very help full Very Happy
DanShadow




PostPosted: Mon Jan 05, 2004 10:02 am   Post subject: (No subject)

lol, your welcome
Skizzarz




PostPosted: Fri Jan 09, 2004 8:25 pm   Post subject: (No subject)

Holy shit, this topic was posted almost a year ago and its still going and not blocked, pretty crazy.

Mod: I splitted the topic, now this part belongs to the help section, like it's suppose to
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Fri Jan 09, 2004 9:17 pm   Post subject: (No subject)

picMerge places the picture on the screen so that the background color of ur picture is not shown
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  [ 9 Posts ]
Jump to:   


Style:  
Search: