Made something new with Mini Micro and here's what it turned out to be. Hope you like it.
Copy and Paste the code which is down below and RUN the program.
It would be also appreciated if you could go and follow me on my game development journey over at my YouTube channel. Here's a link to the trailer of the channel, Hope you enjoy that too...
https://youtu.be/67XlfIDECBQ
The code to the Bouncy Arrow:
clear
// Storing the sprite display (For convenience)
disp = display(4)
// Getting the screen width and height
screenX = 960
screenY = 640
// New sprite and Importing an Image from system (An arrow)
sp = new Sprite
sp.image = file.loadImage("/sys/pics/arrows/arrow2.png")
sp.x = screenX/2
sp.y = screenY/2
// Loading a sound effect
snd = file.loadSound("/sys/sounds/bongo.wav")
// Pushing the sprite to the display
disp.sprites.push sp
flipX = true // Boolean to help in X direction
flipY = true // Boolean to help in Y direction
// playSound = false // Boolean to help with sound effect
speed = 5 // Pre defined speed
while true
if sp.x >= screenX - (sp.image.width / 2) then // Checking if out of screen
flipX = false // in the +ve X direction
snd.play
else if sp.x <= 0 + (sp.image.width / 2) then // Checking if out of screen
flipX = true // in the -ve X direction
snd.play
end if
if sp.y >= screenY - (sp.image.height / 2) then // Checking if out of screen
flipY = false // in the +ve Y direction
snd.play
else if sp.y <= 0 + (sp.image.height / 2) then // Checking if out of screen
flipY = true // in the -ve Y direction
snd.play
end if
sp.x = sp.x + speed * flipX - speed * (not flipX) // X movement
sp.y = sp.y + speed * flipY - speed * (not flipY) // Y movement
// Rotation for the sprite
if flipX and flipY then
sp.rotation = 45
else if flipX and not flipY then
sp.rotation = -45
else if not flipX and flipY then
sp.rotation = 135
else
sp.rotation = -135
end if
yield
end while