
-----------------------------------
fishtastic
Sun Jan 20, 2008 9:27 pm

Matrix Text Effect Game
-----------------------------------
I somehow had the idea of making this, 
I thought if the text flying down the screen were something like "OMGWTFLOL" the it will be really funny :shock: :shock:

Well, here goes another chunk of codes.    :)


% made by fishtastic
% control: left and right arrow.
% have fun!

var map : array 1 .. maxrow, 1 .. maxcol of int
var col : array 1 .. 25 of int
var x := 40
var y := maxrow
var key : array char of boolean
var line := repeat (" ", 26)
var gameOver := false

loop
    put "Enter a Pointless Line. (25 characters or shorter)"
    put "The longer then line is, the harder the game is."
    put ""
    get line : *
    exit when length (line)  0 then
                if 256 + length (line) - map (i, j) > maxcolor then
                    color (green)
                else
                    colour (256 + length (line) - map (i, j))
                end if
                put line (map (i, j)) ..
                if y = i and x = j then
                    gameOver := true
                end if
            else
                if i = y and j = x then
                    color (white)
                    put "@" ..
                else
                    put " " ..
                end if
            end if
        end for
    end for

    for i : 1 .. 25
        drawline (0, Rand.Int (0, maxy), maxx, Rand.Int (0, maxy), black)
    end for

    View.Update
    Input.KeyDown (key)
    if key (KEY_LEFT_ARROW) and x > 1 then
        x -= 1
    end if
    if key (KEY_RIGHT_ARROW) and x < 80 then
        x += 1
    end if

    exit when gameOver
end loop

put "GAME OVER"
View.Update


-----------------------------------
LaZ3R
Tue Jan 22, 2008 2:41 pm

RE:Matrix Text Effect Game
-----------------------------------
Nevermind, I see your comment at the top of the program. Still weird...

-----------------------------------
Gooie
Tue Jan 22, 2008 3:23 pm

Re: Matrix Text Effect Game
-----------------------------------
I love it. Simple, efficient, and fun.

-----------------------------------
Sean
Tue Jan 22, 2008 3:38 pm

Re: Matrix Text Effect Game
-----------------------------------
Interesting, although it did distract some kids in our class from their work the other day.

-----------------------------------
ericfourfour
Tue Jan 22, 2008 4:21 pm

RE:Matrix Text Effect Game
-----------------------------------
Good job. The main loop could use some better organization. The way you have it is:

Draw
Think
Think/Draw
Draw
Flip Backbuffer
Get Input
Think

If you make it so there is only one draw and one think, it will increase readability. You might also consider putting in an FPS limiter (delay or Time.DelaySinceLast) so everyone runs the same program.

-----------------------------------
fishtastic
Tue Jan 22, 2008 8:34 pm

Re: RE:Matrix Text Effect Game
-----------------------------------
Cool comments!!            8-)  8-)  8-)  8-) 

Interesting, although it did distract some kids in our class from their work the other day.
Yes!! my evil plan is starting to work. i will complete screw them by uploading something even more distracting

I love it. Simple, efficient, and fun.
Thank you!

Nevermind, I see your comment at the top of the program. Still weird...
were you trying to say something?


If you make it so there is only one draw and one think, it will increase readability. You might also consider putting in an FPS limiter (delay or Time.DelaySinceLast) so everyone runs the same program.
Yes. I was putting codes in procedure at the beginning, then I put them in the main loop to shorten the code down.
The program I pretty short, but organizing will make it even easier to real.

I found turing slow at out putting on my computer even without delay. but DelaySinceLast will probably maintain FPS in faster Comps.

thanks for all comments  :mrgreen:

-----------------------------------
ericfourfour
Tue Jan 22, 2008 11:57 pm

RE:Matrix Text Effect Game
-----------------------------------
I don't mean you should put all your code into procedures. That is not required right now. Just try to keep everything together. It's a lot easier to get all of the user input, then process it, and then render it.

In Turing, I try to organize my main loop like this:

Get Input (Input.KeyDown, Mouse.Where, hasch, getchar)
Think (process input, do calculations, check if the program should exit)
Render (clear the screen, draw everything)
Flip BackBuffer (View.Update)
FPS Limiter (Time.Delay or Time.DelaySinceLast)

-----------------------------------
Carey
Thu Jan 24, 2008 9:54 am

RE:Matrix Text Effect Game
-----------------------------------
Same with me.I usually build the loop with procedures titled 

loop
  input
  exit when not calculate
  draw
  Time.DelaySinceLast
end loop

With the View.Update inside the draw procedure

-----------------------------------
anna12345
Tue Apr 22, 2008 10:09 am

RE:Matrix Text Effect Game
-----------------------------------
ur a genius)))

-----------------------------------
crysis
Tue Apr 22, 2008 8:25 pm

RE:Matrix Text Effect Game
-----------------------------------
tis is awsome i really enjoyed it however if theres 2 many characters  you get trapped.

-----------------------------------
syntax_error
Tue Apr 22, 2008 9:08 pm

Re: RE:Matrix Text Effect Game
-----------------------------------
tis is awsome i really enjoyed it however if theres 2 many characters  you get trapped.

he states himself: char limit 25.

-----------------------------------
crysis
Wed Apr 23, 2008 8:06 am

RE:Matrix Text Effect Game
-----------------------------------
wat do u mean char limit 25?

-----------------------------------
nastynika
Wed Apr 23, 2008 8:51 am

Re: RE:Matrix Text Effect Game
-----------------------------------
wat do u mean char limit 25?
he means dont use anymore than 25 characters

-----------------------------------
nastynika
Wed Apr 23, 2008 8:52 am

Re: Matrix Text Effect Game
-----------------------------------
nice game 

btw you could try doing something to give u a score or a timer on how long u lasted
