I'm fooling around with mirc scriping a bit and decided to make some sort of irc pong. However, I can't find a good/fast way to draw the ball without having to redraw the backgorund every time. Is there any way to get some type of layers going or something so I dont have to keep reloading the background everytime I move the ball? Here's what I mean: (this is not working pong. It's just an example)
With the red line in place it looks like this:
Except the bar/ball flicker alot. It's redrawing the background and then the ball ontop.
With the red line commented out it looks like this;
The bar/ball do not get erased. It doesn't redraw the background.
Is there anyway to move the bar/ball ontop of the background?
Here's Template.bmp if you want to try it.
http://www.dircen.com/Template.bmp
Code:
alias dpong {
window -c@ @dPong
window -fCadp @dPong -1 -1 640 480
drawpic -cs @dPong 0 0 dpong\Template.bmp
set %dPong_Mouse 50
set %dPong_Ball.x1 150
set %dPong_Ball.y1 140
set %dPong_Dir.x 1
set %dPong_Dir.y 1
timerdPong -m 0 10 { dPong_Update }
}
alias dPong_Update {
dPong_moveBall
[COLOR=Red] drawpic -c @dPong 0 0 dpong\Template.bmp ;I don't want to do this every time :`([/COLOR]
drawpic -c @dPong 100 %dPong_Mouse 640 50 10 50 dpong\Template.bmp
drawpic -c @dPong %dPong_Ball.x1 %dPong_Ball.y1 640 0 10 10 dpong\Template.bmp
}
alias dPong_moveBall {
if (%dPong_Ball.y1 <= 50) %dPong_Dir.y = 1
else if (%dPong_Ball.y1 >= 370) %dPong_Dir.y = -1
%dPong_Ball.y1 = $calc( %dPong_Ball.y1 + %dPong_Dir.y )
if (%dPong_Ball.x1 <= 110) %dPong_Dir.x = 1
else if (%dPong_Ball.x1 >= 530) %dPong_Dir.x = -1
%dPong_Ball.x1 = $calc( %dPong_Ball.x1 + %dPong_Dir.x )
}
menu @dPong {
mouse: {
if ($mouse.y < 50) %dPong_Mouse = 50
else if ($mouse.y > 330) %dPong_Mouse = 330
else %dPong_Mouse = $mouse.y
}
}
on 1:CLOSE:@dPong:{ timerdPong off }
Except the bar/ball flicker alot. It's redrawing the background and then the ball ontop.
With the red line commented out it looks like this;
The bar/ball do not get erased. It doesn't redraw the background.
Is there anyway to move the bar/ball ontop of the background?
Here's Template.bmp if you want to try it.
http://www.dircen.com/Template.bmp