Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Space Invaders help
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
andyman




PostPosted: Thu Jun 12, 2003 6:18 pm   Post subject: Space Invaders help

Confused 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
code:

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
Sponsor
Sponsor
Sponsor
sponsor
Mazer




PostPosted: Thu Jun 12, 2003 6:26 pm   Post subject: (No subject)

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




PostPosted: Thu Jun 12, 2003 7:16 pm   Post subject: (No subject)

are u andy sun?
andyman




PostPosted: Thu Jun 12, 2003 7:25 pm   Post subject: (No subject)

No I'm Andy Johnson
Homer_simpson




PostPosted: Thu Jun 12, 2003 8:16 pm   Post subject: (No subject)

try reading the collision detection tutorials on this website first... theil help u with detecting when the laser hits your enemies...
Asok




PostPosted: Thu Jun 12, 2003 8:47 pm   Post subject: (No subject)

I've made Space Invaders 2.

I'll post it in July.
Andy




PostPosted: Fri Jun 13, 2003 10:39 am   Post subject: (No subject)

hmm isn't it called glaxian
Asok




PostPosted: Fri Jun 13, 2003 1:26 pm   Post subject: (No subject)

MINE is called space invaders 2 Razz
Sponsor
Sponsor
Sponsor
sponsor
naoki




PostPosted: Fri Jun 13, 2003 9:54 pm   Post subject: (No subject)

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




PostPosted: Sat Jun 14, 2003 4:03 pm   Post subject: (No subject)

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




PostPosted: Sun Jun 15, 2003 1:18 pm   Post subject: (No subject)

offscreenonly
View.Update
wait does turing 3.0 have View.Update?
born130




PostPosted: Sun Jun 15, 2003 1:51 pm   Post subject: (No subject)

no
Andy




PostPosted: Sun Jun 15, 2003 3:09 pm   Post subject: (No subject)

and once again, born130 gets 2 bits for 2 lettersr
PaddyLong




PostPosted: Sun Jun 15, 2003 3:10 pm   Post subject: (No subject)

he was answering a question that was asked...
85882




PostPosted: Mon Jun 16, 2003 3:53 pm   Post subject: (No subject)

Your program is good so far. Wink
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 21 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: