←  Programs

ComputerCraft | Programmable Computers for Minecraft

»

Bubbles!

KingofGamesYami's Photo KingofGamesYami 09 Dec 2014

I got bored, made a program that randomly moves bubbles up (bigger ones move faster) on the screen. Not much, it's just kinda pretty... Feel free to improve the code and post your own version :)/>.

I haven't tested on pocket computers, but it generates via the term size, so it should look alright.

pastebin get JCR8YTww

Preview*

*for some reason, this feature of Mimic isn't working for me. Dunno if it's just me or what.
Edited by KingofGamesYami, 09 December 2014 - 03:19 PM.
Quote

thenextntnick's Photo thenextntnick 09 Dec 2014

I made it more like a screensaver. Press a key to interrupt the program and it will quit. It also won't clear the screen.
A little screenie:
Posted Image

Pastebin: 3CeFxk9X
Quote

cdel's Photo cdel 09 Dec 2014

This is really awesome, looks very sexy and is very memorizing. :D
Quote

oeed's Photo oeed 09 Dec 2014

Yea, this is pretty neat. You've got me thinking about making something a little like this for OneOS...

It does noticeably freeze every few seconds though, maybe from a bunch of math.random calls?
Quote

cdel's Photo cdel 09 Dec 2014

 oeed, on 09 December 2014 - 06:38 AM, said:

It does noticeably freeze every few seconds though, maybe from a bunch of math.random calls?

I ran this on Lua Land, didn't experience any spikes whatsoever ?
Quote

oeed's Photo oeed 09 Dec 2014

 cdel, on 09 December 2014 - 06:45 AM, said:

 oeed, on 09 December 2014 - 06:38 AM, said:

It does noticeably freeze every few seconds though, maybe from a bunch of math.random calls?

I ran this on Lua Land, didn't experience any spikes whatsoever ?

Hmm, well I was running it in an emulator. They're not super frequent, but they are there.
Quote

KingofGamesYami's Photo KingofGamesYami 09 Dec 2014

 oeed, on 09 December 2014 - 06:38 AM, said:

It does noticeably freeze every few seconds though, maybe from a bunch of math.random calls?

I've not noticed any freezing, but then I'm using Mimic, so...

The individual 'bubbles' will freeze, but there should always be several moving. I will admit, I do have a lot of math.random calls - but I don't know of any way to speed that up.

Edit: I've updated the pastebin, see if the freezing still occurs. I made the sleep manually and threw everything inside it (If you've done this, you know what I did).
Edited by KingofGamesYami, 09 December 2014 - 03:05 PM.
Quote

Agent Silence's Photo Agent Silence 09 Dec 2014

I made something like this as a test. First it was rain, then I changed it to this matrix type thing. Pastebin is MJvnXB2W
Quote

Geforce Fan's Photo Geforce Fan 13 Dec 2014

 oeed, on 09 December 2014 - 06:38 AM, said:

OneOS
the word most commonly spoke by Oeed
Edited by Geforce Fan, 13 December 2014 - 06:17 AM.
Quote