Discuss Scratch

Mole_Gaming
Scratcher
100+ posts

Making an OS Simulator in Scratch.

Another quick tip.

I assume your first reaction will be to put forever loops under the “application” broadcast for each application.

I am here to tell you to not do that


What I personally do is have a “tick” broadcast. Inside the “main” sprite, there is a forever loop that constantly broadcasts “tick” and waits. Then, in each sprite, it runs the program that would usually be run inside a forever loop.


This, in my experience, greatly reduces lag since you don't have multiple forever loops trying to run simultaneously.

am can program above good
AiyanMind
Scratcher
100+ posts

Making an OS Simulator in Scratch.

Pokey17 wrote:

bobbybee wrote:

Pokey17 wrote:

Chibi-Matoran wrote:

Many of the “operating system” projects on Scratch are not really operating systems, but really fancy GUIs. An operating system consists of many low-level pieces, such as the kernel and bootloader. Scratch doesn't have such low-level capabilities, so you would have to write a virtual machine or emulator in Scratch that provides things like RAM, then write the operating system in the instruction set of the emulator. The whole idea is pretty ambitious - be careful not to choke on your aspirations.

Thank you for the answer, I won't make a real OS though. (As it seems it would be too complicated.) It will be more of a simulator that has an OS feel.
What, um, does an OS “feel” like?

I might of worded it incorrectly, I meant more like to give the player a feeling that it's an OS. Which will be hard to achieve.
Making it look like it's booting up, loading, etc isn't hard because it doesn't have to mean it is actually doing that.

MACERENA
Scratcher
10 posts

Making an OS Simulator in Scratch.

Here's The Desktop :

when I receive [desktop v]
broadcast [Appearing Apps v]

Now, Let's Do Apps Like, “Ping pong”, “Youtube”, And Cookie Clicker.

when I receive [Appearing Apps v]
show

Do That For ALL Of The Apps You Made.
First, We'll Do Youtube.

Upload An Image Like THIS :


For Cookie Clicker.


AND Ping Pong…


The Apps Scripts Will Be Added Later. You're Welcome.
Wettining
Scratcher
500+ posts

Making an OS Simulator in Scratch.

A simulator would be possible and very easy to make in Scratch but it wouldn't be a true operating system with executable binaries and stuff
what everyone else is saying that would be very hard is a OS emulator. If you were to make an emulator it would simulate a CPU and RAM then run the OS on top of that
IronHead43
Scratcher
53 posts

Making an OS Simulator in Scratch.

i deleted this it was not needed for the discussion

Last edited by IronHead43 (Nov. 28, 2017 18:29:14)


IronHead43
hey there! Check out my programming language Blocky! and Online Scratch! (CLOUD)
IronHead43
Scratcher
53 posts

Making an OS Simulator in Scratch.

Wettining wrote:

A simulator would be possible and very easy to make in Scratch but it wouldn't be a true operating system with executable binaries and stuff
what everyone else is saying that would be very hard is a OS emulator. If you were to make an emulator it would simulate a CPU and RAM then run the OS on top of that
i am making OS like that with a simple CPU beginning of a hard drive with saving data and RAM i have am much better one i am working on but here is two attempts https://scratch.mit.edu/projects/188765033/ https://scratch.mit.edu/projects/188680124/

IronHead43
hey there! Check out my programming language Blocky! and Online Scratch! (CLOUD)
DamienMG
Scratcher
2 posts

Making an OS Simulator in Scratch.

Alright for my loading comcept, I do this

when green flag clicked
set [ runtime] to [0]
show variable [ processor power usage]
set [ processor power usage] to [0]
hide variable [ loading %]
hide variable [ Bios]
switch backdrop to [ Black Screen]
wait (.5) secs
broadcast [ message1 or whatever you choose it to be]

that is what I use for my Scratch os's to start the loading runtime, now to get into the loading part

when I receive [ message1]
hide variable [ Bios]
switch backdrop to [ startup1]
wait (1) secs
switch backdrop to [ startup2]
set [ loading %] to [0]
show variable [ Loading %]
repeat (100)
wait (0.01) secs
change [ Loading %] by (1)
end
if <(Loading %) = [100]> then
wait (0.7) secs
hide variable [ Loading %]
wait (0.2) secs
broadcast [ LOGIN]
end

That's how I do that.

Last edited by DamienMG (Feb. 28, 2020 04:45:46)

infinitytec
Scratcher
1000+ posts

Making an OS Simulator in Scratch.

DamienMG wrote:

Alright for my loading comcept, I do this

when green flag clicked
set [ runtime] to [0]
show variable [ processor power usage]
set [ processor power usage] to [0]
hide variable [ loading %]
hide variable [ Bios]
switch backdrop to [ Black Screen]
wait (.5) secs
broadcast [ message1 or whatever you choose it to be]

that is what I use for my Scratch os's to start the loading runtime, now to get into the loading part

when I receive [ message1]
hide variable [ Bios]
switch backdrop to [ startup1]
wait (1) secs
switch backdrop to [ startup2]
set [ loading %] to [0]
show variable [ Loading %]
repeat (100)
wait (0.01) secs
change [ Loading %] by (1)
end
if <(Loading %) = [100]> then
wait (0.7) secs
hide variable [ Loading %]
wait (0.2) secs
broadcast [ LOGIN]
end

That's how I do that.[/quote]
Please create a new topic--this one has been dead since 2017!


Not here much, but sometimes I lurk.
God has a plan. He has a plan for everything, and everyone.
Foxxith
New to Scratch
1 post

Making an OS Simulator in Scratch.

I usually use this for my simulator game

this code is for whatever score you have

when green flag clicked
forever
play sound [whatever sound you have v] until done
end

this is for the shop sprite
when this sprite clicked
broadcast [show v]

now create a shop Title Screen sprite
and use this script for it
when green flag clicked
hide

when I receive [show v]
show

when this sprite clicked
broadcast [hide v]
hide


now make whatever sprite that makes YOUR score go up by random numbers.

when green flag clicked
show

when this sprite clicked
change [YOURSCORE v] by (pick random (2) to (3))

when green flag clicked
set [YOURSCORE v] to [0]

when [1 v] key pressed
wait (0.4) secs
change [YOURSCORE v] by (pick random (2) to (3))

And then yeah, you can add anything in the shop, or not have random numbers. Have a nice christmas!!

Powered by DjangoBB