Woldron pretty much said it already:
Either leave the declaration of p and c global (and why not?) or make a function where you pass in your p and c variables to be used locally in the function.
I can't make it much more simple than that.
Either leave the declaration of p and c global (and why not?) or make a function where you pass in your p and c variables to be used locally in the function.
myfunction(pl.player, com.computer) if imagescollide(pimg,pl\x,pl\y,0,cimg,com\x,com\y,0) then dostuff ;then can your function like this at any time myfunction(p,c)
I can't make it much more simple than that.