
-----------------------------------
1337
Tue Jun 01, 2004 8:50 pm

Help in making a triangle...
-----------------------------------
I know you have to use lines for the triangle, but I tried alot of different numbers and can't figure it out.

Basically, I want it to look like this:
|_
|  _
|    -
|-

Well I'm not a good drawer but the 2 vertices pointing left. They should include the x and y coordinates as it's controlled when I'm making my shooting game. 

Thanks,

-----------------------------------
Paul
Tue Jun 01, 2004 8:53 pm


-----------------------------------
huh? Your picture didn't exactly look like a triangle, do you mean just a triangle with one of it's point pointing directly right?

-----------------------------------
1337
Tue Jun 01, 2004 8:55 pm


-----------------------------------
Yeah, sorry, I suck at drawing :\

|   _
|      _
|   _
|

-----------------------------------
Paul
Tue Jun 01, 2004 8:57 pm


-----------------------------------
huh wha?
anyway tell me if this is close

var x: array 1..3 of int:=init (100, 100, 300)
var y: array 1..3 of int:= init (100, 300, 200)
drawpolygon (x,y,3,12)


so it draws a triangle with vertices (100,100) , (100, 300), (300, 200)

-----------------------------------
Tony
Tue Jun 01, 2004 8:58 pm


-----------------------------------
delta's Pic~2~Code is always useful...

otherwise

var x, y, b : int
loop
    Mouse.Where (x, y, b)
    Draw.Line (x, y, x + 50, y + 50, black)
    Draw.Line (x + 50, y + 50, x, y + 100, black)
    Draw.Line (x, y + 100, x, y, black)
end loop


-----------------------------------
SuperGenius
Tue Jun 01, 2004 8:59 pm


-----------------------------------
to make a triange you need 3 seperate drawline statements. each x and y pair of coords will have to be used twice... so:


var x, y : array 1 .. 3 of int

x (1) := 10
y (1) := 10
x (2) := 10
y (2) := 100
x (3) := 150
y (3) := 50

Draw.Line (x (1), y (1), x (2), y (2), black)
Draw.Line (x (2), y (2), x (3), y (3), black)
Draw.Line (x (1), x (1), x (3), y (3), black)



Draw.Line (10, 10, 10, 100, black)
Draw.Line (10, 100, 150, 50, black)
Draw.Line (10, 10, 150, 50, black)



both of these groups of 3 drawline statements do the same thing.

-----------------------------------
SuperGenius
Tue Jun 01, 2004 9:00 pm


-----------------------------------
oops, it seems I have been beaten to the answer...  :oops:

-----------------------------------
1337
Tue Jun 01, 2004 9:01 pm


-----------------------------------
Well, I'm making a game and the x y coordinates should be controlled by my down and up arrow.

Can you post how it should look like before Input.KeyDown (chars), etc. 
BTW:
x := 10
y := 25
And also, can you make it smaller? Like 1/4th its size.
thanks again

-----------------------------------
Tony
Tue Jun 01, 2004 9:04 pm


-----------------------------------
wow :shock:

-----------------------------------
Paul
Tue Jun 01, 2004 9:14 pm


-----------------------------------
Well, I'm making a game and the x y coordinates should be controlled by my down and up arrow.

Can you post how it should look like before Input.KeyDown (chars), etc. 
BTW:
x := 10
y := 25
And also, can you make it smaller? Like 1/4th its size.
thanks again
well what u can do is make one set of values variables, then make all other values dependent on your one set, that way when one changes, all will change.

-----------------------------------
1337
Wed Jun 02, 2004 5:59 pm


-----------------------------------
var x, y, b : int
loop
    View.Update
    cls
    Mouse.Where (x, y, b)
    Draw.Line (x, y, x + 50, y + 50, 78)
    Draw.Line (x + 50, y + 50, x, y + 100, 78)
    Draw.Line (x, y + 100, x, y, 78)
end loop

Okay, I got that, but now I want to know how to make it so that out of the triangle, red dots start shooting, while it moves with the mouse. Do you use drawline or drawdot, can you show a good example? After that, I want to know how to make ovals in random places through the screen. After that, I'll try to do collision and things, if I need more help I'll ask again :)

Thanks again.

-----------------------------------
Cervantes
Wed Jun 02, 2004 7:59 pm


-----------------------------------
Do you use drawline or drawdot

 red dots start shooting

drawdot  :lol:
though if you want the dots to stay on the screen, you could use either.  also, if you want the dots to be larger then 1x1 pixels, use drawfilloval.

as for how:  if you're shooting out 1 dot then 


if button pressed then
button_pressed := true
end if

if button_pressed = true then
red_dot_x += 1
red_dot_y += 1
drawdot (red_dot_x,red_dot_y, blue)  :lol:
end if


I'm not sure how you want the red dots to shoot out though.  maybe you want one to shoot from each side and to go with slopes of 1 and negative 1.  :think:

-----------------------------------
1337
Thu Jun 03, 2004 10:51 pm


-----------------------------------
I tried collision when it reaches maxx, but it doesn't seem to work. Any help?

    loop
        cls
        Mouse.Where (x, y, b)
        for a4 : 1 .. 10
            x4 (a4) -= 3
            if x4 (a4) < -30 then
                loop
                    EXIT := true
                    x4 (a4) := Rand.Int (maxx, maxx + 700)
                    y4 (a4) := Rand.Int (0, maxy)
                    for c : 1 .. a4 - 1
                        if MathDistance (x4 (a4), y4 (a4), x4 (c), y4 (c)) < 60 then
                            EXIT := false
                        end if
                    end for
                    exit when EXIT = true
                end loop
            end if
            setscreen ("offscreenonly")
            Pic.Draw (picture, x4 (a4), y4 (a4), picMerge)
            Pic.ScreenLoad ("unit.bmp", x, y, picCopy)
        end for
        View.Update
    end loop
    delay (150)
    cls
end if

-----------------------------------
.hack
Sun Jun 06, 2004 4:58 pm


-----------------------------------
if ur making a triangle..go into paint, draw ur triangle,m save it and import it thru GUI? Its not very hard to do, just check out the manual in Turing, Help > "Turing Reference" I believe. Its a basic command..I jsut forget what it is lo

Pic.FileNew App5:("C:\TriangleOF133.JPG) 
or something to taht effect.

-----------------------------------
1337
Sat Jun 12, 2004 9:25 pm


-----------------------------------
Also, I was wondering how you can use Mouse.Where and drawlines so that you can picture a bullet.

Like:

> = ship

> .  .  .  . (and the rest behind goes out)

Kinda like this guys: http://www.compsci.ca/v2/viewtopic.php?t=1340
Thanks again!
