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

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




PostPosted: Tue Jan 16, 2007 6:54 pm   Post subject: transparent problem

I am having a problem with my char, i have it so when he walks the colour goes away, but when he stands still the colour comes back. I am not sure what I have done. Now I am not sure how u guys make it so that u have that special code box so i'll just set it up here. I also am pretty sure that the background colours, in the pics are the same. The main thing that confuses me is that, link stands still even thou it is not in the procedure.

setscreen ("screen:max;max")
View.Set ("offscreenonly")
var LinkShieldStandRight : int
var LinkShieldWalkRight1 : int
var LinkShieldWalkRight2 : int
var LinkShieldWalkRight3 : int
var LinkShieldWalkRight4 : int
var LinkShieldWalkRight5 : int
var LinkShieldWalkRight6 : int
var LinkShieldWalkRight7 : int
%,--------------------------
var LinkShieldStandLeft : int
var LinkShieldWalkLeft1 : int
var LinkShieldWalkLeft2 : int
var LinkShieldWalkLeft3 : int
var LinkShieldWalkLeft4 : int
var LinkShieldWalkLeft5 : int
var LinkShieldWalkLeft6 : int
%,---------------------------
var LinkShieldStandDown : int
var LinkShieldWalkDown1 : int
var LinkShieldWalkDown2 : int
var LinkShieldWalkDown3 : int
var LinkShieldWalkDown4 : int
var LinkShieldWalkDown5 : int
var LinkShieldWalkDown6 : int
var LinkShieldWalkDown7 : int
%,----------------------------
var LinkShieldStandup : int
var LinkShieldWalkup1 : int
var LinkShieldWalkup2 : int
var LinkShieldWalkup3 : int
var LinkShieldWalkup4 : int
var LinkShieldWalkup5 : int
var LinkShieldWalkup6 : int
var LinkShieldWalkup7 : int
%,---------------------------
var LinkSwingLeft1 : int
var LinkSwingLeft2 : int
var LinkSwingLeft3 : int
var LinkSwingLeft4 : int
var LinkSwingLeft5 : int
%,---------------------------
var LinkSwingDown1 : int
var LinkSwingDown2 : int
var LinkSwingDown3 : int
var LinkSwingDown4 : int
var LinkSwingDown5 : int
var LinkSwingDown6 : int
%,---------------------------
var LinkSwingRight1 : int
var LinkSwingRight2 : int
var LinkSwingRight3 : int
var LinkSwingRight4 : int
var LinkSwingRight5 : int
%,---------------------------
var LinkSwingup1 : int
var LinkSwingup2 : int
var LinkSwingup3 : int
var LinkSwingup4 : int
var LinkSwingup5 : int
%,---------------------------
var Health : int
%,----------------------------------------------------------------
var BlueEnemyStandup : int
var BlueSwordEnemyup1 : int
var BlueSwordEnemyup2 : int
var BlueSwordEnemyup3 : int
var BlueSwordEnemyup4 : int
%,--------------------------
var BlueEnemyStandDown : int
var BlueSwordEnemyDown1 : int
var BlueSwordEnemyDown2 : int
var BlueSwordEnemyDown3 : int
var BlueSwordEnemyDown4 : int
%,--------------------------
var BlueEnemyStandRight : int
var BlueSwordEnemyRight1 : int
var BlueSwordEnemyRight2 : int
var BlueSwordEnemyRight3 : int
var BlueSwordEnemyRight4 : int
%,-------------------------
var BlueEnemyStandLeft : int
var BlueSwordEnemyLeft1 : int
var BlueSwordEnemyLeft2 : int
var BlueSwordEnemyLeft3 : int
var BlueSwordEnemyLeft4 : int
%,----------------------------------------------------------
var x : int := 300
var y : int := 300
%,--------------------------
var xblue : int := 200
var yblue : int := 200
%,--------------------------
var xfloor : int := 0
var yfloor : int := 0
%,---------------------------
var floortile : int
var floortile2 : int
var floortilewidth : int
var floortileheight : int
%,----------------------------
LinkShieldWalkDown6 := Pic.FileNew ("Link Shield Walk Down6.bmp")
LinkShieldWalkDown5 := Pic.FileNew ("Link Shield Walk Down5.bmp")
LinkShieldWalkDown4 := Pic.FileNew ("Link Shield Walk Down4.bmp")
LinkShieldWalkDown3 := Pic.FileNew ("Link Shield Walk Down3.bmp")
LinkShieldWalkDown2 := Pic.FileNew ("Link Shield Walk Down2.bmp")
LinkShieldWalkDown1 := Pic.FileNew ("Link Shield Walk Down1.bmp")
LinkShieldStandDown := Pic.FileNew ("Link Shield Stand Down.bmp")
%,--------------------------
LinkShieldWalkup6 := Pic.FileNew ("Link Shield Walk Up6.bmp")
LinkShieldWalkup5 := Pic.FileNew ("Link Shield Walk Up5.bmp")
LinkShieldWalkup3 := Pic.FileNew ("Link Shield Walk Up3.bmp")
LinkShieldWalkup2 := Pic.FileNew ("Link Shield Walk Up2.bmp")
LinkShieldWalkup1 := Pic.FileNew ("Link Shield Walk Up1.bmp")
LinkShieldStandup := Pic.FileNew ("Link Shield Stand Up.bmp")
%,-------------------------
LinkShieldWalkLeft6 := Pic.FileNew ("Link Shield Walk Left6.bmp")
LinkShieldWalkLeft5 := Pic.FileNew ("Link Shield Walk Left5.bmp")
LinkShieldWalkLeft4 := Pic.FileNew ("Link Shield Walk Left4.bmp")
LinkShieldWalkLeft3 := Pic.FileNew ("Link Shield Walk Left3.bmp")
LinkShieldWalkLeft2 := Pic.FileNew ("Link Shield Walk Left2.bmp")
LinkShieldWalkLeft1 := Pic.FileNew ("Link Shield Walk Left1.bmp")
LinkShieldStandLeft := Pic.FileNew ("Link Shield Stand Left.bmp")
%,------------------------
LinkShieldWalkRight6 := Pic.FileNew ("Link Shield Walk Right6.bmp")
LinkShieldWalkRight5 := Pic.FileNew ("Link Shield Walk Right5.bmp")
LinkShieldWalkRight4 := Pic.FileNew ("Link Shield Walk Right4.bmp")
LinkShieldWalkRight3 := Pic.FileNew ("Link Shield Walk Right3.bmp")
LinkShieldWalkRight2 := Pic.FileNew ("Link Shield Walk Right2.bmp")
LinkShieldWalkRight1 := Pic.FileNew ("Link Shield Walk Right1.bmp")
LinkShieldStandRight := Pic.FileNew ("Link Shield Stand Right.bmp")
%,------------------------
LinkSwingup5 := Pic.FileNew ("Link Sword up5.bmp")
LinkSwingup4 := Pic.FileNew ("Link Sword up4.bmp")
LinkSwingup3 := Pic.FileNew ("Link Sword up3.bmp")
LinkSwingup2 := Pic.FileNew ("Link Sword up2.bmp")
LinkSwingup1 := Pic.FileNew ("Link Sword up1.bmp")
%,------------------------
LinkSwingRight4 := Pic.FileNew ("Link Sword Right4.bmp")
LinkSwingRight5 := Pic.FileNew ("Link Sword Right5.bmp")
LinkSwingRight3 := Pic.FileNew ("Link Sword Right3.bmp")
LinkSwingRight2 := Pic.FileNew ("Link Sword Right2.bmp")
LinkSwingRight1 := Pic.FileNew ("Link Sword Right1.bmp")
%,------------------------
LinkSwingDown5 := Pic.FileNew ("Link Sword Down5.bmp")
LinkSwingDown4 := Pic.FileNew ("Link Sword Down4.bmp")
LinkSwingDown3 := Pic.FileNew ("Link Sword Down3.bmp")
LinkSwingDown2 := Pic.FileNew ("Link Sword Down2.bmp")
LinkSwingDown1 := Pic.FileNew ("Link Sword Down1.bmp")
%,------------------------
LinkSwingLeft5 := Pic.FileNew ("Link Sword Left5.bmp")
LinkSwingLeft4 := Pic.FileNew ("Link Sword Left4.bmp")
LinkSwingLeft3 := Pic.FileNew ("Link Sword Left3.bmp")
LinkSwingLeft2 := Pic.FileNew ("Link Sword Left2.bmp")
LinkSwingLeft1 := Pic.FileNew ("Link Sword Left1.bmp")
%,------------------------------------------------------------
BlueEnemyStandDown := Pic.FileNew ("Blue Sword Enemy Stand Down.bmp")
BlueSwordEnemyDown1 := Pic.FileNew ("Blue Sword Enemy Down1.bmp")
BlueSwordEnemyDown2 := Pic.FileNew ("Blue Sword Enemy Down2.bmp")
BlueSwordEnemyDown3 := Pic.FileNew ("Blue Sword Enemy Down3.bmp")
BlueSwordEnemyDown4 := Pic.FileNew ("Blue Sword Enemy Down4.bmp")
%,-----------------------
Pic.SetTransparentColour (LinkShieldStandDown, brightred)
Pic.SetTransparentColour (LinkShieldWalkDown1, brightred)
Pic.SetTransparentColour (LinkShieldWalkDown2, brightred)
Pic.SetTransparentColour (LinkShieldWalkDown3, brightred)
Pic.SetTransparentColour (LinkShieldWalkDown4, brightred)
Pic.SetTransparentColour (LinkShieldWalkDown5, brightred)
Pic.SetTransparentColour (LinkShieldWalkDown6, brightred)
Pic.SetTransparentColour (LinkShieldWalkRight1, brightred)
Pic.SetTransparentColour (LinkShieldWalkRight2, brightred)
Pic.SetTransparentColour (LinkShieldWalkRight3, brightred)
Pic.SetTransparentColour (LinkShieldWalkRight4, brightred)
Pic.SetTransparentColour (LinkShieldWalkRight5, brightred)
Pic.SetTransparentColour (LinkShieldWalkRight6, brightred)
%,-------------------------
floortile := Pic.FileNew ("floor.bmp")
%,------------------------
var chleft : boolean := true
var chright : boolean := false
var chup : boolean := false
var chdown : boolean := false
%,------------------------
var EnemyBlueleft : boolean := true
var EnemyBlueright : boolean := false
var EnemyBlueup : boolean := false
var EnemyBluedown : boolean := false
%,------------------------
procedure LinkWalkRight

Pic.Draw (LinkShieldWalkRight1, x, y, picMerge)
View.Update
x := x + 5
delay (100)
cls


Pic.Draw (LinkShieldWalkRight2, x, y, picMerge)
View.Update
x := x + 5
delay (100)
cls


Pic.Draw (LinkShieldWalkRight3, x, y, picMerge)
View.Update
x := x + 5
delay (100)
cls



Pic.Draw (LinkShieldWalkRight4, x, y, picMerge)
View.Update
x := x + 5
delay (100)
cls


Pic.Draw (LinkShieldWalkRight5, x, y, picMerge)
View.Update
x := x + 5
delay (100)
cls



Pic.Draw (LinkShieldWalkRight6, x, y, picMerge)
View.Update
x := x + 5
delay (100)
cls

end LinkWalkRight

procedure LinkWalkLeft


Pic.Draw (LinkShieldWalkLeft1, x, y, picMerge)
View.Update
x := x - 5
delay (100)
cls


Pic.Draw (LinkShieldWalkLeft2, x, y, picMerge)
View.Update
x := x - 5
delay (100)
cls


Pic.Draw (LinkShieldWalkLeft3, x, y, picMerge)
View.Update
x := x - 5
delay (100)
cls



Pic.Draw (LinkShieldWalkLeft4, x, y, picMerge)
View.Update
x := x - 5
delay (100)
cls


Pic.Draw (LinkShieldWalkLeft5, x, y, picMerge)
View.Update
x := x - 5
delay (100)
cls



Pic.Draw (LinkShieldWalkLeft6, x, y, picMerge)
View.Update
x := x - 5
delay (100)
cls

end LinkWalkLeft

procedure LinkWalkup


Pic.Draw (LinkShieldWalkup1, x, y, picMerge)
View.Update
y := y + 5
delay (100)
cls


Pic.Draw (LinkShieldWalkup2, x, y, picMerge)
View.Update
y := y + 5
delay (100)
cls


Pic.Draw (LinkShieldWalkup3, x, y, picMerge)
View.Update
y := y + 5
delay (100)
cls


LinkShieldWalkup4 := Pic.FileNew ("Link Shield Walk Up4.bmp")
Pic.Draw (LinkShieldWalkup4, x, y, picMerge)
View.Update
y := y + 5
delay (100)
cls


Pic.Draw (LinkShieldWalkup5, x, y, picMerge)
View.Update
y := y + 5
delay (100)
cls



Pic.Draw (LinkShieldWalkup6, x, y, picMerge)
View.Update
y := y + 5
delay (100)
cls

end LinkWalkup

procedure LinkWalkDown


Pic.Draw (LinkShieldWalkDown1, x, y, picMerge)
View.Update
y := y - 5
delay (100)
cls


Pic.Draw (LinkShieldWalkDown2, x, y, picMerge)
View.Update
y := y - 5
delay (100)
cls


Pic.Draw (LinkShieldWalkDown3, x, y, picMerge)
View.Update
y := y - 5
delay (100)
cls



Pic.Draw (LinkShieldWalkDown4, x, y, picMerge)
View.Update
y := y - 5
delay (100)
cls


Pic.Draw (LinkShieldWalkDown5, x, y, picMerge)
View.Update
y := y - 5
delay (100)
cls



Pic.Draw (LinkShieldWalkDown6, x, y, picMerge)
View.Update
y := y - 5
delay (100)
cls

end LinkWalkDown

procedure LinkSwingLeft


Pic.Draw (LinkSwingLeft1, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingLeft2, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingLeft3, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingLeft4, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingLeft5, x, y, picMerge)
View.Update
delay (70)
cls
end LinkSwingLeft

procedure LinkSwingDown


Pic.Draw (LinkSwingDown1, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingDown2, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingDown3, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingDown4, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingDown5, x, y, picMerge)
View.Update
delay (70)
cls
end LinkSwingDown

procedure LinkSwingRight


Pic.Draw (LinkSwingRight1, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingRight2, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingRight3, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingRight4, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingRight5, x, y, picMerge)
View.Update
delay (70)
cls
end LinkSwingRight

procedure LinkSwingup


Pic.Draw (LinkSwingup1, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingup2, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingup3, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingup4, x, y, picMerge)
View.Update
delay (70)
cls


Pic.Draw (LinkSwingup5, x, y, picMerge)
View.Update
delay (70)
cls
end LinkSwingup

var chars : array char of boolean
Pic.Draw (floortile, 1, 1, picCopy)
View.Update

loop
Input.KeyDown (chars)
if chars (KEY_RIGHT_ARROW) then
LinkWalkRight
chleft := false
chright := true
chdown := false
chup := false
elsif chars (KEY_LEFT_ARROW) then
LinkWalkLeft
chleft := true
chright := false
chdown := false
chup := false
elsif chars (KEY_UP_ARROW) then
LinkWalkup
chleft := false
chright := false
chdown := false
chup := true
elsif chars (KEY_DOWN_ARROW) then
LinkWalkDown
chleft := false
chright := false
chdown := true
chup := false
elsif chars ('a') then
LinkSwingLeft
chleft := true
chright := false
chdown := false
chup := false
elsif chars ('s') then
LinkSwingDown
chleft := false
chright := false
chdown := true
chup := false
elsif chars ('d') then
LinkSwingRight
chleft := false
chright := true
chdown := false
chup := false
elsif chars ('w') then
LinkSwingup
chleft := false
chright := false
chdown := false
chup := true
end if
%,-------------------------
if chleft = true then
Pic.Draw (LinkShieldStandLeft, x, y, picCopy)
View.Update
elsif chright = true then
Pic.Draw (LinkShieldStandRight, x, y, picCopy)
View.Update
elsif chup = true then
Pic.Draw (LinkShieldStandup, x, y, picCopy)
View.Update
elsif chdown = true then
Pic.Draw (LinkShieldStandDown, x, y, picCopy)
View.Update
end if
end loop
Sponsor
Sponsor
Sponsor
sponsor
apomb




PostPosted: Tue Jan 16, 2007 7:16 pm   Post subject: Re: transparent problem

i cant wait for someone to take a stab at helping you... sadly, i fear if i start, i wont be able to stop correcting all that is wrong with your lack of arrays, code tags, loops, formatting ... the list goes on Confused
Barda4




PostPosted: Tue Jan 16, 2007 7:44 pm   Post subject: Re: transparent problem

I don't care if I am missing arrays, or loop format, I'm in gr 10 i just started to learn this 3-4 months ago!! I just want to know how to make the code WORK!! i have 1 week to finish this, and format is not rlly an issue right now!
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: