About: Counting Sprites   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

There may come a time when a user may need to assign an arbitrary number of sprites a unique identifier. For instance, say the user has ten bullet sprites with a local variable. Rather than individually assigning each of them a number in a set () to () block, it might be handy to do this automatically. That way, a script could specifically call bullet number seven without hard-coding it. First, create a global (spriteCount) variable. Then, on the stage add this code: When flag clicked: set spriteCount to 0 broadcast [count sprites] and wait //do something afterwards

AttributesValues
rdfs:label
  • Counting Sprites
rdfs:comment
  • There may come a time when a user may need to assign an arbitrary number of sprites a unique identifier. For instance, say the user has ten bullet sprites with a local variable. Rather than individually assigning each of them a number in a set () to () block, it might be handy to do this automatically. That way, a script could specifically call bullet number seven without hard-coding it. First, create a global (spriteCount) variable. Then, on the stage add this code: When flag clicked: set spriteCount to 0 broadcast [count sprites] and wait //do something afterwards
dcterms:subject
abstract
  • There may come a time when a user may need to assign an arbitrary number of sprites a unique identifier. For instance, say the user has ten bullet sprites with a local variable. Rather than individually assigning each of them a number in a set () to () block, it might be handy to do this automatically. That way, a script could specifically call bullet number seven without hard-coding it. First, create a global (spriteCount) variable. Then, on the stage add this code: When flag clicked: set spriteCount to 0 broadcast [count sprites] and wait //do something afterwards Now, for all the sprites you want to count (and generally these will be clones of the same sprite) add this script: When I receive [count sprites]: change spriteCount by 1 set myNumber to spriteCount //Swap these to start the count at 0 instead of 1 Then, when the flag is clicked, each sprite will get a unique number in (myNumber).
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software