
-----------------------------------
jedi-bob
Fri Jan 16, 2004 3:34 pm

Help on Metal Gear Solid style game
-----------------------------------
i am new to turing and i want to make a game like the radar on the Metal Gear games, (I thought it would be easy).  For anyone who knows what i am talking about, i wanted to do something like the VR missions, where you have to get to the goal without being seen. My characters are little circles and i finally got them to move. I was wondering if i could get help making larger somewhat transparent cirles over the enemies so that if I go into that range i will get caught by the enemy?

ps- what are bits, what are they for??

-----------------------------------
Tony
Fri Jan 16, 2004 3:47 pm


-----------------------------------
you could draw semi-transparent circles using RGB. module, but my guess is that resulting speed will make the game unplayable

-----------------------------------
jedi-bob
Mon Jan 19, 2004 10:00 am


-----------------------------------
i put yellow circles under them instead of semi-transparent ones over them.

-----------------------------------
Mazer
Mon Jan 19, 2004 10:19 am


-----------------------------------
Make a picture in paint, then make half of the pixels white (do it in a checkerboard pattern). Then draw the picture using picMerge and it'll be as semi-transparent as you can get it using Turing whilst keeping a decent speed.

-----------------------------------
Dan
Mon Jan 19, 2004 11:18 am


-----------------------------------
i bivle the new turing 4.0.5 will/dose have new opttions for transparcenys in pictuchers.

-----------------------------------
jedi-bob
Mon Jan 19, 2004 3:02 pm


-----------------------------------
i need help again, i want to make it so my character (a filled in circle) cant pass through walls.

-----------------------------------
jedi-bob
Mon Jan 19, 2004 3:39 pm


-----------------------------------
More Help.......... is there anyway i can declare my circle so that i can use it in an if statement??, or its coords?


for example:
 if CIRCLECOORDS= x,y,x2,y2= whatever  then
cls
put"you got caught"

-----------------------------------
Mazer
Mon Jan 19, 2004 6:10 pm


-----------------------------------
i bivle the new turing 4.0.5 will/dose have new opttions for transparcenys in pictuchers.
As far as I know, the commands are just to set which colour in the picture will be transparent... which if I'm not mistaken was already possible. :P

jedi-bob, use the force... no, wait, use the coords (and the radius). Compare the distance from the centre of your circle to some point with the radius of the circle, and if the radius is greater or equal, they've collided. In the most recent update to turing, they've actually made a note of explain collision detection. And in case you don't have the latest version of turing, here's the source: (I sure hope holtsoft won't be so petty as to get upset about sharing example code)

% The "Math.Distance" program.
const RADIUS := 75
loop
    var x1, y1, x2, y2 : int
    x1 := Rand.Int (RADIUS, maxx - RADIUS)
    y1 := Rand.Int (RADIUS, maxy - RADIUS)
    x2 := Rand.Int (RADIUS, maxx - RADIUS)
    y2 := Rand.Int (RADIUS, maxy - RADIUS)
    cls
    drawfilloval (x1, y1, RADIUS, RADIUS, brightred)
    drawfilloval (x2, y2, RADIUS, RADIUS, brightgreen)
    locate (1, 1)
    if Math.Distance (x1, y1, x2, y2) < RADIUS * 2 then
        put "The two circles touch"
    else
        put "The two circles do not touch"
    end if
    delay (2000)
    exit when hasch
end loop


-----------------------------------
jedi-bob
Tue Jan 20, 2004 9:56 am


-----------------------------------
thanks, but one problem it says Distance isn't in the export list of Math

-----------------------------------
Mazer
Tue Jan 20, 2004 10:22 am


-----------------------------------
thanks, but one problem it says Distance isn't in the export list of Math
Right... I'm stupid. I posted code from turing 4.0.5 in case you didn't have 4.0.5 without realizing that if you don't have 4.0.5, the code wouldn't work. Meh.
I suppose you could just change the Math.Distance to:

round (sqrt ((x2-x1)**2 + (y2-y1)**2))

Or something like that, it's too cold now to think...

-----------------------------------
jedi-bob
Tue Jan 20, 2004 10:56 am


-----------------------------------
i got it to work. This is only the begining i will add more levels later.


colorback (255)
cls
color  (10)
locate(10,24)
put"Welcome to.........."
delay(1000)
cls
locate(10,5)
put"Guy Who runs from ''bad'' people who may or may not violently execute him"
delay(5000)
cls
put"Instuctions"
locate(5,1)
put"Get to the goal without being seen by enemies."   
delay(2000)
cls 
put"These are the enemies"
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(3000)
cls
put"This is what the enemy looks like"
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
delay(500)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
delay(500)
drawfilloval(500,200,10,10,red)delay(500)
drawfilloval(500,200,50,50,yellow)
delay(500)
drawfilloval(500,200,10,10,red)
delay(750)
cls
put"This is the area where he will see or hear you"
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(1500)
drawfilloval(500,200,50,50,black)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,black)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,black)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,black)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(750)
cls
put"If you go into his area of vision, or hearing, you will be caught and killed"
%borrowed
delay(1500)
Draw.FillBox (0, 0, maxx, maxy, 255) 
colorback (255) 
color (10) 
var zz : int := 1 
for i : 1 .. 100 
    delay (50) 
    Draw.FillBox (100, 15, 100 + zz, 25, 54) 
    Draw.Box (100, 15, 200, 25, 1) 
    zz := zz + 1 
    locate (23, 13) 
    put "Loading... ", zz, "%" .. 
end for 
locate (23, 13) 
put "Done Loading!   " .. 
delay(1000)
colorback(white)
cls
%main character
var a,b : int 
a:=100 
b:=100 
%enemy 1
var a2,b2: int
a2:=500
b2:=200
%enemy 2
var a3,b3: int
a3:=200
b3:=100
%goal
var g1,g2 : int
g1:=620
g2:=370

var chars : array char of boolean 
        loop 
            Input.KeyDown (chars) 
            
            if chars (KEY_UP_ARROW) then 
            drawfilloval(a,b,10,10,white)    
            b:=b+3 
            end if 
            if chars (KEY_RIGHT_ARROW) then 
            drawfilloval(a,b,10,10,white)    
            a:=a+3 
            end if 
            if chars (KEY_LEFT_ARROW) then 
            drawfilloval(a,b,10,10,white)    
            a:=a-3 
            end if 
            if chars (KEY_DOWN_ARROW) then 
            drawfilloval(a,b,10,10,white)    
            b:=b-3 
            end if 
            
            drawfilloval(a,b,10,10,red) 
            delay(10) 
       
drawfilloval(a2,b2,50,50,yellow)
drawfilloval(a2,b2,10,10,red)

drawfilloval(a3,b3,50,50,yellow)
drawfilloval(a3,b3,10,10,red)

drawoval(620,370,20,20,black)

var distance := ((a2-a)*(a2-a) + (b2-b)*(b2-b))**0.5 
var distance2 := ((a3-a)*(a3-a) + (b3-b)*(b3-b))**0.5
var distance3 := ((g1-a)*(g1-a) + (g2-b)*(g2-b))**0.5
var radius1:=10
var radius2:=50
var radius3:=20
%you take the square of differences of X coordinates and add 
%a square of differences of Y coordinates then take a square 
%root of the sum 
%%%%%% 
%I did (x)*(x) instead of x**2 because exponents is a function 
%and it takes up more resourses then *, thus its faster 
%Also **0.5 is the same as sqrt() - learn your math guys 
if distance  < radius1 + radius2 

%might be a good idea to save radious1+radious2 as const/var 
then 
colorback(black)
cls
put"You have been spotted, the enemy has captured and killed you."
delay(2000)
exit
elsif distance2 < radius1 + radius2
then 
colorback(black)
cls
put"You have been spotted, the enemy has violently executed you."
delay(2000)
exit

elsif distance3 < radius1 + radius3
then 
colorback(black)
cls
put"You made it to the goal."
delay(2000)
exit

end if 

end loop
cls
delay(1000)
quit
