
-----------------------------------
Metal Mayhem
Fri Jul 07, 2006 7:49 pm

Terrorist Attack
-----------------------------------
Made This In about 15 Minutes Played it for a hour and 15 minutes have fun

-----------------------------------
Tony
Fri Jul 07, 2006 8:16 pm


-----------------------------------
Coding wise it could use some improvements

for X : 1 .. maxx
                for Y : 1 .. maxy
                    if View.WhatDotColour (X, Y) = green then

is by far not the best approach.

Though I've got to admit, this is a very creative use of Draw.Fill :D

One improvement I want to suggest is a detonator key, to speed up the game play.

+Bits

-----------------------------------
NikG
Fri Jul 07, 2006 10:39 pm


-----------------------------------
Though I've got to admit, this is a very creative use of Draw.Fill :DI definitely agree.

Good job. Only suggestion I have (other than Tony's detonator suggestion) is to contol where the bombs are created because right now they can overlap.

Tip to all who play: draw squares around the bomb, not circles.

-----------------------------------
Delos
Fri Jul 07, 2006 10:58 pm


-----------------------------------
I like it!  This is a good start - keep at it and you will improve tremendously.  Hit up the [Turing Walkthrough] to check out some of the tuts available.  You're off to a good start.

+bits

-----------------------------------
Tony
Sat Jul 08, 2006 12:11 am


-----------------------------------
Tip to all who play: draw squares around the bomb, not circles.
Better tip is to draw continues shapes around clusters of bombs, you don't need a polygon around each bomb.

A better tip is that since (1,1) location is the only thing you're trying to protect...

-----------------------------------
NikG
Sat Jul 08, 2006 1:47 am


-----------------------------------
A better tip is that since (1,1) location is the only thing you're trying to protect...
Whoa, that's quite a trick!

I guess you'd need a check for every pixel on the screen to fight that...

-----------------------------------
Clayton
Sat Jul 08, 2006 4:00 pm


-----------------------------------
Ha Tony! I tried that before i even read the rest of the posts.

Now as for the coding, why not have a [url=http://compsci.ca/v2/viewtopic.php?t=9636]record for all of your boxes for each round? then you can have a [url=http://compsci.ca/v2/viewtopic.php?t=6723]flexible array of all of your boxes. This way you can drastically cut down on your searching for green pixels by using the x and y coordinates of a box, Draw.Fill'ing from it, check to see if (1,1) is red, if it isnt, check another box, etc etc, until either (1,1) is red, or (1,1) isnt red.

EDIT: You could also randomize the point at which you check for an uncovered bomb, this would be to stop people like Tony and myself from cheating  :twisted: , just make sure that a bomb doesnt cover that point :wink: Also, note that this should have been submitted in [Turing Source Code], [Turing Applications] is where your zipped .exes etc go :D

EDIT 2: Here is your game modified with records and a randomized checking point (note its an exe so you cant copy :D), try and recreate what I have done. Notice that chances are you cant try what Tony did anymore, and that the check and Draw.Fill goes much faster now. If you have any questions post and someone will help you out.

-----------------------------------
Tony
Sun Jul 09, 2006 12:34 am


-----------------------------------
You could also randomize the point at which you check for an uncovered bomb, this would be to stop people like Tony and myself from cheating  :twisted: , just make sure that a bomb doesnt cover that point :wink:
Do you mind sharing that part of the code? :wink: 

Randomization kind of sucks since under same conditions you sometimes win and sometimes loose.

I suppose a better way would be to "protect the targets", so let the user know precisely where the checks will be done. And have enough to ensure that it's still easier to circle the bombs (original intent) rather then protecting just few targets. I think that if flow gets to the edge of the screen, that should be count as a lost

-----------------------------------
iker
Wed Jul 12, 2006 5:11 pm


-----------------------------------
Its a simple game thats fun. Now i have a suggestion for scoring. You should have a counter for the amount of pixils that are shown after the explosion. If the circles are too big, then theres more red pixils, or a bigger explosion. If the counter gets too high for any level, then the person should lose. So right where the program draws the red dots, you could add the counter, and reset it for each level.

-----------------------------------
Clayton
Wed Jul 12, 2006 7:51 pm


-----------------------------------

Do you mind sharing that part of the code?


hm, well ill try, I'm in Belleville right now (about three hours away from where I live) and I wont be getting home untill July 29, so I dont exactly have the code with me right now...

However, all is not lost, I will do my best and try and remember how it went...

NOTE: I dont have access to Turing, so if this code doesn't run, dont harp about it plz :D


var box : flexible array 1..0 of 
    record
        x,y : int
    end record
var check_x, check_y : int
var right : boolean := false
var bombs : int := 1
const radius : int := 40
const size : int := 15
loop
     loop
        new box, bombs
            loop
                exit when right
                right := false
                check_x := Rand.Int (1, maxx)
                check_y := Rand.Int (1, maxy)
                for j : 1..bombs
                    box(j).x := Rand.Int(1,maxx-size)
                    box(j).y := Rand.Int(1,maxy-size)
                    exit when Math.Distance(box(j).x + size div 2, box(j).y + size div 2, check_x, check_y) 