I have been playing with the idea of a scorched earth clone, to pwn kerm's version (not that I currently have time to make it) but I did come up with a nice random level generator.


Code:

:ClrDraw
:randInt(15,25->B
:For(A,0,94
:randInt(-3,3->C
:B+C->B
:Line(A,0,A,B
:End



I haven't decided if/when I will go about making the rest of the game, but for the most part, I got that much done Razz
How about:


Code:

:ClrDraw
:randInt(15,25->B
:For(A,0,94
:B+randInt(-3,3->B
:Line(A,0,A,B
:End
I started with that, but the terrain didn't look natural enough for my tastes, hence the substantially more complex algorithm I design.
yeh, what angel and tifreak propose makes for very very jagged looking terrain.
What I proposed was the exact same thing as what TIFreak8x did, just saving a couple of bytes and freeing up a variable.
???!!! Please look at the FIRST post, all he did was take out a line, that I at one point had a good reason for, but cannot remember what I was going to add to that point.
What about this?

Code:

:ClrDraw
:randInt(15,25->B
:For(A,0,94
:randInt(1,3->C
:B+randInt(-C,C->B
:Line(A,0,A,B
:End

That will make it change the levels of jaggedness.
I was thinking something more along the lines of this:
Code:
:15+(11rand
:For(A,0,94
:Line(A,0,A,Ans
:Ans+int(7rand)-3
:End
You can easily change the increment of the terrain.
-1 to 1: int(3rand)-1
-2 to 2: int(5rand)-2
-4 to 4: int(9rand)-4
Here is a method I came up with while messing around today...


Code:

setup code...
0->xmin
94->xmax
0->ymin
62-ymax
axesoff
gridoff

---

clrdraw
randint(20,35->c
for(a,0,94
randint(-3,3->b
if b=-1 or b=1:0->b ------------ or if you can just remove one of the b='s
if b=2:1->b---optional line, sometimes works, other times not so good =O
if c>58:-1->b
if c<4:1->b
c+b->c
line(a,0,a,c
end


You can screw around with the conditionals to get different results.[/code]
i just got an idea on how to make the map conform differently when hit by a bomb, as in bomb lands beside a hill, have the side of the hill avalanche down, i will begin working on my own scorched earth clone to pwn kerms and tifreak's (although it will probably be far less efficient)
Pseudoprogrammer wrote:
i just got an idea on how to make the map conform differently when hit by a bomb, as in bomb lands beside a hill, have the side of the hill avalanche down, i will begin working on my own scorched earth clone to pwn kerms and tifreak's (although it will probably be far less efficient)


That will be enormously frustrating in basic... Your going to have to track each of the "particles" movements for the avalance, atleast if you want realism at all Razz
Harrierfalcon wrote:
I was thinking something more along the lines of this:
Code:
:15+(11rand
:For(A,0,94
:Line(A,0,A,Ans
:Ans+int(7rand)-3
:End
You can easily change the increment of the terrain.
-1 to 1: int(3rand)-1
-2 to 2: int(5rand)-2
-4 to 4: int(9rand)-4
Due to recent revelations at UTI, you may replace the int(rand thing with randInt(, which is faster
Here's the method that creates realistic terrain (from Scarth):

Code:
:¦ ¦ ClrDraw
:¦ ¦ Horizontal(55
:¦ ¦ DelVar J
:¦ ¦ Repeat K=105
:¦ ¦ ¦ Text(0,1,"<",sub("BLANDHILLYROUGH",1+5J,5),">
:¦ ¦ ¦ getKey→K
:¦ ¦ ¦ J-(K=24)(J≠0)+(K=26)(J≠2→J
:¦ ¦ End
:¦ ¦ Text(0,1,">
:¦ ¦ Text(0,25,"...
:¦ ¦ randInt(10,40→X:DelVar Z
:¦ ¦ For(N,0,94
:¦ ¦ ¦ Line(N,0,N,X(X<56)+55(X>55
:¦ ¦ ¦ X+Z→X:Z-(X>43)+(X<10)+(X<44)(X>9)randInt(‾J-(J=0),J+(J=0)+(X<4)-(X>49)-(Z>J+1)+(Z<‾J-1→Z
:¦ ¦ End
  
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement