Skip to content

Instantly share code, notes, and snippets.

@jmccardle
Last active February 1, 2026 16:41
Show Gist options
  • Select an option

  • Save jmccardle/d6f5480207d856b929be3bc56ed81550 to your computer and use it in GitHub Desktop.

Select an option

Save jmccardle/d6f5480207d856b929be3bc56ed81550 to your computer and use it in GitHub Desktop.
frame = mcrfpy.Frame(
(20, 20),
(140, 60),
fill_color = (64, 64, 196)
)
cap = mcrfpy.Caption(
(10,10),
text="Hello\nMcRogueFace\n\nWASD to move!",
outline=2,
outline_color=(64,64,64)
)
cap.parent = frame
frame.parent = mcrfpy.current_scene
sprite = mcrfpy.Sprite(
align = mcrfpy.Alignment.CENTER,
sprite_index = 84,
scale = 5.0,
)
sprite.parent = mcrfpy.current_scene
def keys(key, state):
if key == mcrfpy.Key.W:
sprite.y -= 10
elif key == mcrfpy.Key.A:
sprite.x -= 10
elif key == mcrfpy.Key.S:
sprite.y += 10
elif key == mcrfpy.Key.D:
sprite.x += 10
mcrfpy.current_scene.on_key = keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment