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

Username:   Password: 
 RegisterRegister   
 change picture in input
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TrAnCeIn4LiFe




PostPosted: Mon Jun 21, 2004 4:44 pm   Post subject: change picture in input

ok so i got most fo the stuff working i'm working on unlocable characters for my game now.. so i'm kidna stuck and i need help i have for one character when u use ur special he changes and beofre he uses special he is normal. so my question is how can i get that picture to be as input key left and right for like minute when i mvoe left and right Sad
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Mon Jun 21, 2004 4:53 pm   Post subject: (No subject)

Ok...first you'll need a couple of extra pic streams. One of them will be for your usual char anim. The other will be for 'special anim'. I.e., the same picture but w/ some fancy effects added...etc etc.

Now, in the loop/procedure/etc in which you draw your pics each frame, add an if condition to say: if the User is pressing the 'left' key (for instance), then draw the normal picture at the known xy coords.
Or...if the User is pressing the 'right' key, then draw the 'special' pic at the known xy coords.

If you want to set it so that it goes special then stays like that for a while...just use some form of timer...be it by Time.Elapsed()ing it, or by counting loops...or whatever else tickles your fancy.
Suggestion, don't use a process to time anything, Time.Elapsed() is better than any process you could make w/ regards to timing.
TrAnCeIn4LiFe




PostPosted: Tue Jun 22, 2004 2:10 pm   Post subject: (No subject)

ok i got the special stuff etc.. and time also but my question for movment is like i already have normal declared in inputkey down for left and right what pic to display so now when i example press z for special it will shwo him power up and then the picture input keydown picture should change. so i guess my question is how can i deleta the already picture in input key down for elft and right and replace them with specuial pics when the z is pressed....

so here is my code

code:

var draconian : array 1 .. 2 of int % movment
for x : 1 .. 2
    draconian (x) := Pic.FileNew ("draconian" + intstr (x) + ".bmp")
end for

var draconian_attack : array 1 .. 4 of int % first 2 attack ,2nd 2 special
for x : 1 .. 4
    draconian_attack (x) := Pic.FileNew ("draconian_attack" + intstr (x) + ".bmp")
end for

var draconian_defend : array 1 .. 2 of int % defend
for x : 1 .. 2
    draconian_defend (x) := Pic.FileNew ("draconian_defend" + intstr (x) + ".bmp")
end for

    %/%%%%%%%%%%%%%%%
    %             Input Keys               %
    %%%%%%%%%%%%%%%\%

    Input.KeyDown (chars)

    if chars (KEY_RIGHT_ARROW) then
        for x : 1 .. 1
            Pic.Draw (background (2), 0, 0, picCopy)
            Pic.Draw (draconian (2), px, py, picMerge)
            position1 := px
            px += +4
        end for
    elsif chars (KEY_LEFT_ARROW) then
        for x : 1 .. 2
            Pic.Draw (background (2), 0, 0, picCopy)
            Pic.Draw (draconian (1), px, py, picMerge)
            px += -4
            position2 := px
        end for
    elsif chars ('x') then % normal attack
        View.Update
        fork draconianattack
    elsif chars ('z') then %special attack
        View.Update
        fork draconianspecial
    elsif chars ('c') then % block attack
        View.Update

    end if


so i would need the left and right pics to be replaced with pic3 attack and pic4 attack...
Delos




PostPosted: Tue Jun 22, 2004 8:50 pm   Post subject: (No subject)

Urgh...I don't want to know why you're using process()es...

Anywho.

Just add some more ifs to it...like
if pressing left key, and Special is off, then...dot dot dot
else if pressing left, and Special is ON!, yeah, then...dot dot dot...

&c &c &c
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  [ 4 Posts ]
Jump to:   


Style:  
Search: