-- My Game
-- Use this function to perform your initial setup
function setup()
print("A Miguel Cordova Production!")
math.random(10)
if n<6 then
sprite("Small World:Explosion", 150, 150)
else sound(DATA, "ZgBAOgBAQEBAQEBCggjUPmf0DD/mg1Y/VQBAf0FAQEFAQEBA")
end
end
-- This function gets called once every frame
function draw()
-- This sets a dark background color
background(40, 40, 50)
-- This sets the line thickness
strokeWidth(5)
-- Do your drawing here
end--
-- My Game
function setup()
print("A Miguel Cordova Production!")
end
function draw()
background(40, 40, 50)
n=math.random(10)
if n<6 then
sprite("Small World:Explosion", 150, 150)
else
sound(DATA, "ZgBAOgBAQEBAQEBCggjUPmf0DD/mg1Y/VQBAf0FAQEFAQEBA")
end
end
@MCorova18 I’m guessing your code isn’t working. Please, when you are asking for help, tell us what you think is the problem. If you just say “Can someone please help me with this code” that implies many different things.
But if you are wondering why the sprite isn’t appearing, its because you didn’t set n to math.random(10)