Game
Sonic.Exe: Spirits of Nightmare
5 years ago

(Bonus!)

Time to tell what I've learned during the Lua learning.

Note: This is long and easy to learn. I like showing tutorials! If you want more, I will do it!


math.random(), a script that randomizes things.

math.random() that is blank, generates a number between 0 and 1. For an example:

math.random() Expected Output: -- the console is the output.

0.986203 -- this is our answer. Listen closely. this next part is going to be a little harder to understand. So read multiple times to understand!

a math.random() with numbers in it such as math.random(1,8) generates a number between 1 and 8

math.random(1,8)

print(number) Expected Output:

3

Let's try making a script out of this.

local numbers = math.random(1,3) -- a local must always be behind the value you want to. Unlike Python, you can just use numbers = instead.

if numbers == 1 then -- must be double equals or it will break. In Python, then dosen't exist. You instead use : instead of then.

print("Value is 1.") -- prints it to the Output.

else if number == 2 then -- I strongly prefer else if instead of elseif. The elseif dosen't generate an end. It just is a definition that if something else happens, it does that.

print("Value is 2.")

else if numbers == 3 then

print("Value is 3.")

end

end

end -- an end must ALWAYS be after if an function like if then, while do, function() and more. The script will BREAK if you don't put an end in it.



0 comments

Loading...

Next up

Lil' leak for Knuckles, it's SLIGHTLY better/different than the previous leak. 2/3

The intro used when you get bad ending, when you get this, you know you messed up.

Wait.. 100 views!? Okay hold up...

Here! Alright, here is what you wanted.

Last Zone for Secret Ending ;)

Hoochie Mama. It's been so long. Almost a month! Alright, you guys deserve a leak from the Knuckles' gliding sprite test! It's not ready yet. I'm pressuring myself so much that it's taken a month to reply. Here's a GIF. (Bad quality.)

Posting more Leaks SOON! Be sure to follow this game for the latest leaks! Here's Another look in the game. Also More Soundtracks to come, Good News is: The game is about 35% Done. Bad News is the game is slowing down in development.

Family band complete!

A Shiny Mega Gengar 🌟 For @ManutkArt 's #ThreeColorsChallenge!

"Day to Day" (also check spud out here he's a great guy and writer: https://soundcloud.com/spudward)