Terrorist Attack
Author |
Message |
Metal Mayhem
|
Posted: Fri Jul 07, 2006 7:49 pm Post subject: Terrorist Attack |
|
|
Made This In about 15 Minutes Played it for a hour and 15 minutes have fun
Description: |
|
Download |
Filename: |
terrorist.t |
Filesize: |
1.6 KB |
Downloaded: |
357 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
|
|
|
|
NikG
|
Posted: Fri Jul 07, 2006 10:39 pm Post subject: (No subject) |
|
|
Tony wrote: Though I've got to admit, this is a very creative use of Draw.Fill I 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
|
Posted: Fri Jul 07, 2006 10:58 pm Post subject: (No subject) |
|
|
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
|
Posted: Sat Jul 08, 2006 12:11 am Post subject: (No subject) |
|
|
NikG wrote: 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...
Description: |
|
Filesize: |
7.4 KB |
Viewed: |
2368 Time(s) |
|
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
NikG
|
Posted: Sat Jul 08, 2006 1:47 am Post subject: (No subject) |
|
|
Tony wrote: 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
|
Posted: Sat Jul 08, 2006 4:00 pm Post subject: (No subject) |
|
|
Ha Tony! I tried that before i even read the rest of the posts.
Now as for the coding, why not have a record for all of your boxes for each round? then you can have a 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 , just make sure that a bomb doesnt cover that point Also, note that this should have been submitted in [Turing Source Code], [Turing Applications] is where your zipped .exes etc go
EDIT 2: Here is your game modified with records and a randomized checking point (note its an exe so you cant copy ), 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
|
|
|
|
|
Sponsor Sponsor
|
|
|
iker
|
Posted: Wed Jul 12, 2006 5:11 pm Post subject: (No subject) |
|
|
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
|
Posted: Wed Jul 12, 2006 7:51 pm Post subject: (No subject) |
|
|
Tony wrote:
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
Turing: |
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 ) <= radius
right := true
end for
end loop
%do the rest of the game here...
end loop
end loop
|
That is basically it i believe, pop that into his code and see if it works, if you find an error try and fix it, or post back here and tell me about it.
If you dont know what is going on here... go back to a classroom (j/k). Okay, basically, i randomize the checking point, check to see if it is within a specified radius, if it is, start the loop over again, etc etc, until the check point is far away enough from the bombs, then go onto the game.
I realize that this could be a very long process at later stages of the game, however this makes the game much harder and could make game last less time, but theres the code, make what you will of it
EDIT: 3 edits later i think i have the code logically organized...
EDIT2 : not quite, i have 4 edits here...
|
|
|
|
|
|
|
|