ID:1487189
 
(See the best response by Koshigia.)
Code:


Problem description:I'm sure you've heard of the android game called 'flappy bird.' In the game, they have randomly generated tunnels and its always different.

I don't even have a clue on where to start lol.
That's funny, Flappy Bird is actually an incredibly simple game as far as I can tell. I'm not surprised that a BYONDer would want to clone it, since it's well within what BYOND can do, but I guess I didn't expect anyone to have trouble doing so.

Anyway, I think the trick here is to move the map horizontally, not the player.

Generating pipes is a matter of creating walls periodically, leaving a hole to fit through. Then, as I said above, you'd move the walls every frame until they fall off the other side of the map.
Yeah, it is simple, I just don't know how to generate these walls
I haven't played flappy bird but I would think you would check if the wall hit the x.min og the map and if so del the wall or remove it from map
So I have a obj spawning a /object/tunnel.

Then the tunnel obj will create more pipes..

How can I make it so these pipes the tunnel just created are apart of the tunnel. Such as, the pipes move with the the tunnel and if you bump the pipe the whole tunnel stops also.

Should I make it one big icon?

_>
Best response
When you create the pipes from the tunnel, you simply need a way to reference back and forth...

tunnel
var/list/pipes = new

proc/SpawnPipe()
var/pipe/newpipe = new()
pipes.Add(newpipe)
newpipe.my_tunnel = src

obj/pipe
var/tunnel/my_tunnel


Now, whenever someone runs into a pipe, you have a way to tell the whole tunnel to stop. Apply this principle on a larger scale if you want a tunnel to contain more than just pipes.
You would make the new pipes x relative to the previous tunnels x.