Skip to content

Instantly share code, notes, and snippets.

@faretek1
Last active October 11, 2025 22:22
Show Gist options
  • Save faretek1/4519a838fce921769a9d86c2b2a35c95 to your computer and use it in GitHub Desktop.
Save faretek1/4519a838fce921769a9d86c2b2a35c95 to your computer and use it in GitHub Desktop.
Hopefully comprehensive list of all commands that should work with the hypothetical '@' syntax in goboscript

This is a concept for an @ syntax for referencing sprites in goboscript.

  • @gobo references the sprite gobo
  • @ references the current sprite
  • @(expr) allows getting a sprite dynamically - with the name which is generated by expr
@.direction += 15;
@.direction -= 15;
# *=, /=, //=, %= would need to use point in direction block 
# that would be a lot of implementations, considering all the different attributes, so there is abstraction needed here
@.direction = 90;

goto @gobo;
glide 1, @gobo;
point_towards @gobo;

@.x += 10;
@.x = 0;
@.y += 10;
@.y = 10;

@.x
@.y
@.direction

@.costume_number = 10;
@.costume_number++; # next costume
# these would need to use the switch costume block
# in fact, if a js/json number is passed into that block, it uses costume number
# so it can work reliably, even with costumes called '1', since that would be switched to when passing in a string
@.costume_number = 10; # this means that the input here will need to be casted to a number. this can be done just by adding 0
@.costume_name = "gobo"; # these would need to be casted to strings, which can be done by joining an empty string
@.costume_name &= "2"; # this is a command which should only do stuff when there is a costume called 'gobo2'.
# if the costume is now "1":
@.costume_name += 2; # this would try to change the costume to the one called '3', if there is one
# i.e.: switch_costume costume_name() + $val

@stage.backdrop_number++; # this is harder to write than the current command
# but you could use this syntax to change multiple backdrops at once
@stage.backdrop_number += 3;
@stage.backdrop_name = "stars";
@stage.backdrop_name &= " zoomed in";
@.costume_number
@.costume_name
@stage.backdrop_number; # this is harder to write
@stage.backdrop_name # with code completion it isn't *that* bad, but still

@.size
@.size = 100;
@.size += 12;

@.volume
@.volume = 100;
@.volume += -10;

create_clone @gobo; # if you use just @ here it doesn't actually need to convert to _myself_

touching(@gobo)
distance_to(@gobo)
@gobo.x/y/direction/size/costume_number/costume_name/size/volume/<for-this-sprite variables>
@stage.backdrop_number/backdrop_name/volume/<for-all-sprites variables - this exists but is pretty useless>
@faretek1
Copy link
Author

faretek1 commented Apr 7, 2025

probably not comprehensive but a range of examples

@faretek1
Copy link
Author

also a lot of work
is this really needed
probably not
itd be cool tho ig but not worth the work

@faretek1
Copy link
Author

consider @.dir or even @.d over @.direction. same could go for @.size -> @.s

@faretek1
Copy link
Author

builtin 'procs' could even be remapped to be sprite attributes

@faretek1
Copy link
Author

so point towards @gobo could become @gobo.point_towards()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment