JScratch
Loading...
Searching...
No Matches
generated.Sprite1 Class Reference
Inheritance diagram for generated.Sprite1:
generated.BSprite com.jscratch.Sprite com.jscratch.ScratchObject

Public Member Functions

 Sprite1 ()
void movec (int amt, int dir)
Public Member Functions inherited from generated.BSprite
 BSprite (String name)
void update ()
void goTo (int x, int y)
void changeY (int y)
void changeX (int x)
void walk (int steps)
void goToFront ()
void goToBack ()
boolean isDirEqualTo (int dir)
void animateTurn (int dir, double time)
void animateTurn (int dir, double time, String curveType)
boolean isOnStage ()
void resetCostumes ()
Public Member Functions inherited from com.jscratch.Sprite
 Sprite (String name)
void setStage (Stage stage)
double getX ()
double getY ()
double getScaleX ()
double getScaleY ()
double getWidth ()
double getHeight ()
void whenClicked (Runnable action)
void whenScaleChanged (java.util.function.BiConsumer< Double, Double > action)
boolean containsPoint (int mx, int my)
void handleMouseClick (int mx, int my)
void handleScaleChange (double oldScale, double newScale)
void draw (Graphics2D g)
double width ()
double height ()
void setScaleX (double sx)
void setScaleY (double sy)
Rectangle getBounds ()
void move (double steps)
void turnRight (double deg)
void turnLeft (double deg)
void pointInDirection (double dir)
void goTo (double x, double y)
void changeXBy (double dx)
void changeYBy (double dy)
void glide (double sec, double tx, double ty)
void goToRandomPosition ()
void ifOnEdgeBounce ()
void setEffect (String effect, double value)
void changeEffectBy (String effect, double amount)
void clearGraphicsEffects ()
void say (String text)
void say (String text, double sec)
void switchCostume (String n)
void nextCostume ()
void setSize (double s)
void changeSizeBy (double a)
void show ()
void hide ()
boolean isVisible ()
void addCostume (Costume c)
boolean isTouching (Sprite o)
boolean isTouchingColor (Color c)
void setRotationStyle (RotationStyle s)
Object getVariable (String name)
Public Member Functions inherited from com.jscratch.ScratchObject
 ScratchObject (String name)
String getName ()
void setVariable (String name, Object value)
double getVariableAsNumber (String name)
String getVariableAsString (String name)
String answer ()
void changeVariableBy (String name, double amount)
List< Object > getList (String name)
void addToList (String listName, Object item)
void deleteFromList (String listName, int index)
Object itemOfList (String listName, int index)
int pickRandom (int min, int max)
String join (Object a, Object b)
String letterOf (int index, String text)
int lengthOf (String text)
void startScript (Runnable script)
void broadcast (String message)
void whenIReceive (String message, Runnable action)
void whenKeyPressed (int keyCode, Runnable action)
void waitTillNextFrame ()
void wait (double sec)
void playSound (String soundPath)
void stopAllSounds ()
void setVolume (double percent)

Public Attributes

int mv = 5
double turnSpeed = 0.25
Public Attributes inherited from generated.BSprite
int xx = 0
int yy = 0
int scale = 1

Additional Inherited Members

Static Public Member Functions inherited from com.jscratch.Sprite
static BufferedImage createPlaceholder (Color c, int w, int h)
Protected Member Functions inherited from com.jscratch.ScratchObject
double castToDouble (Object o)
String castToString (Object o)
Protected Attributes inherited from com.jscratch.ScratchObject
String name
Map< String, Object > variables = new ConcurrentHashMap<>()
Map< String, List< Object > > lists = new ConcurrentHashMap<>()
double volume = 100
List< Thread > activeScripts = new CopyOnWriteArrayList<>()

Detailed Description

Definition at line 16 of file Sprite1.java.

Constructor & Destructor Documentation

◆ Sprite1()

generated.Sprite1.Sprite1 ( )

Definition at line 20 of file Sprite1.java.

Member Function Documentation

◆ movec()

void generated.Sprite1.movec ( int amt,
int dir )

Definition at line 155 of file Sprite1.java.

Member Data Documentation

◆ mv

int generated.Sprite1.mv = 5

Definition at line 17 of file Sprite1.java.

◆ turnSpeed

double generated.Sprite1.turnSpeed = 0.25

Definition at line 18 of file Sprite1.java.


The documentation for this class was generated from the following file: