
-----------------------------------
andyman
Thu Jun 12, 2003 6:18 pm

Space Invaders help
-----------------------------------
:? I've been designing a space invaders game on Turing 3. something and I can't figure out how to make the laser (the red thing that comes out of triangle) shoot and destroy oncoming enemies from the right. Unfortunately the extent of my teachers turing knowledge is a put statement and I'm the smartest guy in my class *laugh*. He doesn't even know how to update turing on our school's server! 

Anywho, here's the program so far

var w : int := Window.Open ("fullscreen")
Window.Set (w, "nocursor")
setscreen ("graphics")

% Background
drawbox ( - 1, - 1, 800, 601, 54)
drawfill (1, 1, 16, 54)

% Basic
drawline (100, 5, 150, 26, 55)
drawline (100, 55, 150, 26, 55)
drawline (100, 55, 100, 5, 55)
drawfill (105, 16, 55, 55)

%Controls
var x, e : int
var c : string (1)
x := 0
loop
    getch (c)
    if c = chr (200) and x < 540 then

        drawline (100, x, 150, 21 + x, 55)
        drawline (100, 50 + x, 150, 21 + x, 55)
        drawline (100, 50 + x, 100, x, 55)
        drawfill (1, 1, 16, 54)
        x := x + 5
        e := 26 + x
    elsif c = chr (208) and x > 0 then
        drawline (100, 10 + x, 150, 31 + x, 55)
        drawline (100, 60 + x, 150, 31 + x, 55)
        drawline (100, 60 + x, 100, 10 + x, 55)
        drawfill (1, 1, 16, 54)
        x := x - 5
        e := 26 + x
    elsif c = chr (205) then
        for t : 1 .. 700 by 10
            drawline (150 + t, e, 180 + t, e, red)
            delay (10)
            drawline (150 + t, e, 180 + t, e, 16)
        end for
    end if

    drawline (100, 5 + x, 150, e, 55)
    drawline (100, 55 + x, 150, e, 55)
    drawline (100, 55 + x, 100, 5 + x, 55)
    drawfill (105, 15 + x, 55, 55)



end loop


If you could help me  or just give me tips ASAP, I'd really appreciate it

-----------------------------------
Mazer
Thu Jun 12, 2003 6:26 pm


-----------------------------------
before you go any further i'm gonna have to ask you to switch to turing v4.04 if you have it. games that use the keyboard are just awful without Input.KeyDown.

and if you don't have turing 4, i suggest using the mouse for flying the ship. ie, if the mouse y coord is greater than the ship's y coord, increase y, if it is lower, decrease y. in case you don't know how to use the mouse there are some good tutorials somewhere around here:
http://www.compsci.ca/bbs/viewtopic.php?t=6

-----------------------------------
born130
Thu Jun 12, 2003 7:16 pm


-----------------------------------
are u andy sun?

-----------------------------------
andyman
Thu Jun 12, 2003 7:25 pm


-----------------------------------
No I'm Andy Johnson

-----------------------------------
Homer_simpson
Thu Jun 12, 2003 8:16 pm


-----------------------------------
try reading the collision detection tutorials on this website first... theil help u with detecting when the laser hits your enemies...

-----------------------------------
Asok
Thu Jun 12, 2003 8:47 pm


-----------------------------------
I've made Space Invaders 2.

I'll post it in July.

-----------------------------------
Andy
Fri Jun 13, 2003 10:39 am


-----------------------------------
hmm isn't it called glaxian

-----------------------------------
Asok
Fri Jun 13, 2003 1:26 pm


-----------------------------------
MINE is called space invaders 2 :P

-----------------------------------
naoki
Fri Jun 13, 2003 9:54 pm


-----------------------------------
use like a process to control a shooting animation so it'll shoot while u move

everything else is just collision detection and seeing when you hit the upper bound, when the max number of bullets is achieved, and so on. i won't tell u everything, experiment 1st and then i'll help u some more

-----------------------------------
Andy
Sat Jun 14, 2003 4:03 pm


-----------------------------------
born 130, shut up, stop saying my full name u fag and no its not me, u'd know i'm better than that and i dun use turing 3

-----------------------------------
hello
Sun Jun 15, 2003 1:18 pm


-----------------------------------
offscreenonly
View.Update 
wait does turing 3.0 have View.Update?

-----------------------------------
born130
Sun Jun 15, 2003 1:51 pm


-----------------------------------
no

-----------------------------------
Andy
Sun Jun 15, 2003 3:09 pm


-----------------------------------
and once again, born130 gets 2 bits for 2 lettersr

-----------------------------------
PaddyLong
Sun Jun 15, 2003 3:10 pm


-----------------------------------
he was answering a question that was asked...

-----------------------------------
85882
Mon Jun 16, 2003 3:53 pm


-----------------------------------
Your program is good so far.  :wink:

-----------------------------------
Andy
Mon Jun 16, 2003 4:40 pm


-----------------------------------
and hello, only turing 4.01p and up has View.Update

-----------------------------------
Andy
Mon Jun 16, 2003 4:42 pm


-----------------------------------
hey the next version of turing 4.04d has View.UpdateArea and Window.UpdateArea which allows the user to only View.Update a small area, very useful

-----------------------------------
naoki
Mon Jun 16, 2003 4:54 pm


-----------------------------------
would've prolly helped my game. i could make the bullets nicer w/out making the whole damn screen flicker.

for those who don't know, it was a Raiden-esque shooter

-----------------------------------
Andy
Mon Jun 16, 2003 4:57 pm


-----------------------------------
read my post naoki, its out NEXT version, not this version

-----------------------------------
BlAcK TuRtLe
Wed Jun 18, 2003 3:37 pm


-----------------------------------
when does the next version come out?

-----------------------------------
JayLo
Wed Jun 18, 2003 3:46 pm


-----------------------------------
well... according to Tom West: June 2003. according to reality: next year? who cares?
