Bar Help
Author |
Message |
TopBypass
|
Posted: Sat Jan 19, 2008 1:07 pm Post subject: Bar Help |
|
|
Alright what i am trying to do is make it so this ball is reflected every time it is hit by a box (just like pong) But i cant get a bar! Here is what i have so far.
code: | View.Set("graphics:max;max;noecho,offscreenonly")
var x, y: int := 10
var int_xdiff : int:= 10
var int_ydiff : int := 10
loop
cls
Draw.FillOval (x, y, 10, 10, black)
View.Update
x += int_xdiff
y += int_ydiff
if x < 10 or x > maxx - 10 then
int_xdiff := -int_xdiff
end if
if y < 10 or y > maxy - 10 then
int_ydiff := -int_ydiff
end if
end loop
|
I also need to have have it sensitive so it reflects the ball and have it only be able to go up and down. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
TopBypass
|
Posted: Sat Jan 19, 2008 1:35 pm Post subject: RE:Bar Help |
|
|
Alright i have edited it and added a new bar. All i need help with is moving it and having it sensitive to contact with the ball. |
|
|
|
|
![](images/spacer.gif) |
TopBypass
|
Posted: Sat Jan 19, 2008 2:23 pm Post subject: RE:Bar Help |
|
|
can someone please help me. This is what i have so far
code: |
View.Set("graphics:max;max;noecho,offscreenonly")
var x, y :int := 600
var x2, y2 :int := 0
var int_xdiff : int:= 10
var int_ydiff : int := 10
loop
cls
Draw.FillOval (x, y, 10, 10, black)
drawfillbox (x2, y2, 20, 300, black)
View.Update
x += int_xdiff
y += int_ydiff
if x < 10 or x > maxx - 10 then
int_xdiff := -int_xdiff
end if
if y < 10 or y > maxy - 10 then
int_ydiff := -int_ydiff
end if
end loop
|
I need help with making the bar a solid object. |
|
|
|
|
![](images/spacer.gif) |
isaiahk9
![](http://compsci.ca/v3/uploads/user_avatars/1465120414488e669e1f83a.jpg)
|
Posted: Wed May 07, 2008 7:43 pm Post subject: RE:Bar Help |
|
|
The simplest way to do this is you need to make the paddle a different color. let's say its 11 (brightred).
If View.WhatDotColor (ball-x, ball-y) = 11 then
ball is bounced
Use View.WhatDotColor for colision detection. For more info, go into tutorials or click F10 - turing index. |
|
|
|
|
![](images/spacer.gif) |
|
|