
-----------------------------------
upthescale
Sun Jun 25, 2006 11:52 am

Asteroids
-----------------------------------
Yes, I have finally attempted this game. I was always scared and nervous because:

a) I never knew how to work flexible arrays
b) I never knew trig

Well now:

a) I know flexible arrays
b) I know trig

So I bring to you...

Asteroids

Instructions are in the game, and good luck. Ps, there are 20 levels!

*EDIT- Thank you Tony for taking my Lamer ranking off, hopefully this game will redeem me![/i]

-----------------------------------
Delos
Sun Jun 25, 2006 3:33 pm


-----------------------------------
On attmepting to open rar:


Error opening file.


-----------------------------------
NikG
Sun Jun 25, 2006 6:31 pm


-----------------------------------
I didn't have an error opening the file.

But I did die almost immediately after the game started.
Care to explain upthescale?

Also, make it so you can skip that intro screen.

-----------------------------------
upthescale
Sun Jun 25, 2006 6:51 pm


-----------------------------------
um u shudn't die, i never did, ddi u rerun it and try again?


the intro screen doesn't take that long!

-----------------------------------
Clayton
Sun Jun 25, 2006 9:21 pm


-----------------------------------
Hm, i suggest that you have some sort of execution time control, on my computer that thing runs a way too fast :( i can barely see the thing move and i dont have any control over it barely cuz it moves so fast, oh, and you really should have some way to skip the intro, and be careful with the word wrap too :wink:

-----------------------------------
upthescale
Sun Jun 25, 2006 10:22 pm


-----------------------------------
why u guys complaining over nothing? i can see the speed, bvut the intro? it takes two seconds

and wut wordwrap?

-----------------------------------
NikG
Tue Jun 27, 2006 12:14 am


-----------------------------------
why u guys complaining over nothing? i can see the speed, bvut the intro? it takes two seconds

and wut wordwrap?ok....
Why are you posting if you don't want to hear suggestions???
That's the point of putting stuff up here, not just to post your 100th game.
Everything that has been said was so that you could actually improve your work for once, not just forget about it and move on.

edit: and I'm sure the word wrap SuperFreak82 is referring to do is in your intro screen, how some of the words wrap to the next line

-----------------------------------
rownale
Tue Jun 27, 2006 8:33 am

Good Job
-----------------------------------
I managed to play this game and it worked fine. 
The intro is too long though (I timed it at about 15 seconds lawl)
And the words in the intro do wrap into the next line.  

The main part of the game was pretty good though.  
I really wish i knew how to use trig...

Good job

-----------------------------------
Clayton
Tue Jun 27, 2006 12:57 pm


-----------------------------------
is there something wrong with your keyboard or something? i mean there is no reason for that poor of spelling, unless you have an actual reason (such as Dan being dyslexic), and like NikG said, we are not complaining, we are trying to give you helpful hints to help you improve your game, we are not saying it is crap, but that there are ways for it to be improved, there is no such thing as a perfect program, there will always be problems, whether tolerable or not. as for the word wrap thing, that means that some of your words end up being cut off and wrapping(sp?) from line to line (eg. that has "th" on one line and "at" on the line below it)

-----------------------------------
Delos
Tue Jun 27, 2006 1:17 pm


-----------------------------------
upthescale has been queried about queried about his keyboard's state of integrity several times.  Thus far, he is yet to give a satisfactory response.   :wink:

-----------------------------------
upthescale
Tue Jun 27, 2006 4:47 pm


-----------------------------------
When did I make a spelling Error SuperFreak and Cervcante?

-----------------------------------
Clayton
Tue Jun 27, 2006 5:36 pm


-----------------------------------
its not just spelling, but grammar too, if you post something like

"herez my pr0gGi, tell me Use liked"

are you honestly going to give that a proper response? also, "Cervcante"? my oh my people have trouble spelling your name Cervantes :D I once remember Clevernuts but lets not go there :D

-----------------------------------
upthescale
Tue Jun 27, 2006 5:50 pm


-----------------------------------
heres my prggi is on one of onetruegods forums:)

-----------------------------------
Clayton
Tue Jun 27, 2006 6:02 pm


-----------------------------------
You do realize that you have just gotten rid of your Lamer rank right? You do realize part of the reason you got it was for massive spamming right? Do you now realize that you are walking right back into that Lamer rank? The above post was not only pure spam, but utterly and completely childish.

-----------------------------------
Cervantes
Tue Jun 27, 2006 7:31 pm


-----------------------------------
The above post was not only pure spam, but utterly and completely childish.
Childish? I don't even understand what it means. :lol:

As for the state of upthescale's keyboard, perhaps it's not a keyboard problem. It may be some memory problem. As evidence, I present:
When did I make a spelling Error SuperFreak and Cervcante?
Who, me? I hadn't posted in this thread when he said that. :lol:

So the moral of the story is this. Upthescale, you need to do less spamming and communicate a bit better. It is rather difficult to understand what you're saying, quite often. And spamming is against [The Rules]. You've received a lavish amount of warnings. Think about what you're posting before you post it. If it's a one line comment that isn't directly answering a question, there's a pretty good chance it's spam.

-----------------------------------
upthescale
Tue Jun 27, 2006 7:42 pm


-----------------------------------
Sorry Cervantes lol i think i meatn someone else!

-----------------------------------
TokenHerbz
Sat Aug 12, 2006 11:40 pm


-----------------------------------
Is my astroids betteR????

TO SHOOT:::   LEFT CTRL
TO MOVE:::: ARROW KEYS
TO EXIT::::    ESC

::::: Next im going to try to add upgrades, and a better detection system aswell as fixing some of my messy code in there :(


%%game window
var game_window : int
game_window := Window.Open ("Graphics: max;max, title: Basic Astroids")
View.Set ("offscreenonly, noecho, nocursor, nobuttonbar")



%%Variables
%%for the back ground stars
var xStar : array 1 .. 50 of int
var yStar : array 1 .. 50 of int
%%randomize their variables
for i : 1 .. 50
    randint (xStar (i), 0, maxx)
    randint (yStar (i), 0, maxy)
end for

%%ship points
var xPoint : array 1 .. 3 of real
var yPoint : array 1 .. 3 of real

var rotate : real := 0
var angle : real := 90
var keys : array char of boolean
var game_level : int := 0
var score : int := 0
var oldscore : int := 0
var life : int := 3
var leave_for : boolean := false

%%ship speed
var xSpeed : real := 0
var ySpeed : real := 0

%%ships bullets
type Bullets :
    record
        x : real
        y : real
        xdir : real
        ydir : real
        distance : real
    end record

var Bullet : flexible array 0 .. 0 of Bullets
var chance_to_spawn_upgrade : int := 2

%%Declare and Set Center Point
var xCenter : real
var yCenter : real

%%astroids
type astroids :
    record
        x : int
        y : int
        xs : int %%speed (it;ll be for direction too)
        ys : int
        size : int
        amount : int
    end record

var Astroid : flexible array 0 .. 0 of astroids

%%set value's
xPoint (1) := 100   %%(1) = left, 2 = top, 3 = right
yPoint (1) := 100
xPoint (2) := 105
yPoint (2) := 120
xPoint (3) := 110
yPoint (3) := 100

%%procs

%%this will rotate the ship points
proc Rotate_Ship (var x : real, var y : real, var cx : real, var cy : real, var deg : real) %%gets chords per point
    %%temperary variables
    var tempx : real
    var tempy : real
    tempx := ((x - cx) * cosd (deg) - (y - cy) * sind (deg)) + cx %Rotate x Point
    tempy := ((x - cx) * sind (deg) + (y - cy) * cosd (deg)) + cy %Rotate y Point
    %%reset the vars
    x := tempx
    y := tempy
end Rotate_Ship

%%this will draw anything needed in the game
proc Drawing
    %%the back ground screen
    Draw.FillBox (0, 0, maxx, maxy, black)
    for i : 1 .. 50
        Draw.FillOval (xStar (i), yStar (i), 1, 1, white)
    end for
    %%display (level/score/life)
    color (gray)
    colorback (black)
    locate (2, 10)
    put "Level:  ", game_level
    locate (2, 50)
    put "Lives:  ", life
    locate (2, 90)
    put "Score:  ", score
    %%the ship
    drawline (round (xPoint (1)), round (yPoint (1)), round (xPoint (2)), round (yPoint (2)), white)
    drawline (round (xPoint (2)), round (yPoint (2)), round (xPoint (3)), round (yPoint (3)), white)
    drawline (round (xPoint (3)), round (yPoint (3)), round (xPoint (1)), round (yPoint (1)), white)
    %%bullets
    for i : 1 .. upper (Bullet)
        Draw.FillOval (round (Bullet (i).x), round (Bullet (i).y), 1, 1, white)
    end for
    %%astroids
    for i : 1 .. upper (Astroid)
        Draw.Oval (Astroid (i).x, Astroid (i).y, Astroid (i).size, Astroid (i).size, white)
    end for
end Drawing

%%this will shoot the bullet
proc Shooting
    Input.KeyDown (keys)

    %%spawns you a bullet
    if keys (KEY_CTRL) then %%shoots the bullet
        if upper (Bullet) + 1  10 then
            ySpeed := 10
            %%going BottomLeft
        elsif xSpeed < -10 then
            xSpeed := -10
        elsif ySpeed < -10 then
            ySpeed := -10
        end if
    end if

    %%moves the ship
    xCenter += xSpeed
    yCenter += ySpeed
    for i : 1 .. 3
        xPoint (i) += xSpeed
        yPoint (i) += ySpeed
    end for


    %%For astroids
    %%if no astroids then...
    if upper (Astroid)  maxx - 1 and xPoint (2) > maxx - 1 and xPoint (3) > maxx - 1 then
        for i : 1 .. 3
            xPoint (i) -= maxx
        end for
    end if
    if yPoint (1) < 1 and yPoint (2) < 1 and yPoint (3) < 1 then
        for i : 1 .. 3
            yPoint (i) += maxy
        end for
    elsif yPoint (1) > maxy - 1 and yPoint (2) > maxy - 1 and yPoint (3) > maxy - 1 then
        for i : 1 .. 3
            yPoint (i) -= maxy
        end for
    end if

    %%make the bullets warp
    for i : 1 .. upper (Bullet)
        if Bullet (i).x >= maxx - 1 then
            Bullet (i).x -= maxx
        elsif Bullet (i).x = maxy - 1 then
            Bullet (i).y -= maxy
        elsif Bullet (i).y  10 then
                    if Astroid (i).size = 40 then
                        score += 20
                        oldscore += 20
                    else
                        score += 50
                        oldscore += 50
                    end if
                    new Astroid, upper (Astroid) + 1     %%add's 1 for breaking onto two
                    Astroid (upper (Astroid)) := Astroid (i)
                    Astroid (i).xs += 1
                    Astroid (upper (Astroid)).xs -= 1
                    Astroid (i).ys += 1
                    Astroid (upper (Astroid)).ys -= 1
                    Astroid (i).size -= Astroid (i).size div 2
                    Astroid (upper (Astroid)).size -= Astroid (upper (Astroid)).size div 2
                else        %%this KILLS the small ones
                    score += 100
                    oldscore += 100
                    if i = upper (Astroid) then
                        new Astroid, upper (Astroid) - 1
                    else
                        Astroid (i) := Astroid (upper (Astroid))
                        new Astroid, upper (Astroid) - 1
                    end if
                end if
                leave_for := true
                %%kill the bullet used
                Bullet (j) := Bullet (upper (Bullet))
                new Bullet, upper (Bullet) - 1
                exit        %%needed to kill the bullet correctly.
            end if
        end for
        if leave_for = true then
            exit
        end if
    end for

    %%add's a life at a certain pointage's
    if oldscore >= 1240 then     %(equivilent to 2 astroids)
        oldscore -= 1240
        life += 1
    end if

    %%ship collition (means you lose)
    for i : 1 .. upper (Astroid)
        leave_for := false
        for j : 1 .. 3     %%the ships points
            if xPoint (j) = Astroid (i).x - Astroid (i).size and
                    yPoint (j) = Astroid (i).y - Astroid (i).size then
                if xPoint (j) < 300 then
                    for h : 1 .. 3
                        xPoint (h) += 200
                    end for
                else
                    for h : 1 .. 3
                        xPoint (h) -= 200
                    end for
                end if
                if yPoint (j) < 300 then
                    for h : 1 .. 3
                        yPoint (h) += 200
                    end for
                else
                    for h : 1 .. 3
                        yPoint (h) -= 200
                    end for
                end if
                life -= 1     %%take off a life
            end if
        end for
    end for
end Boundries


%%main loop
loop
    Input.KeyDown (keys)
    cls

    Drawing         %%draws everything
    Move_Obsticles      %%moves ship/astroids
    Boundries       %%what it says
    Shooting        %%creats/moves bullets

    %%Exit the game
    if keys (KEY_ESC) then
        exit
    end if
    %%or lose
    if life 