screeps-starter-python
1.0.0
1.0.0
  • Introduction
  • Logistics
    • Setup
    • Upgrading Transcrypt
  • Screeps API Usage
    • Constants
    • Optional Arguments
    • Objects - Basic Interaction
    • Objects - Creation and the Keyword "new"
  • Features
    • Console Commands
  • Lodash
    • Introduction
    • As Arguments to API Methods
  • Syntax Changes
    • Summary
    • in Opperator
    • List Behavior
    • del Operator
    • dict Iteration
Powered by GitBook
On this page

Was this helpful?

  1. Screeps API Usage

Objects - Basic Interaction

Entities in the game world exist as object prototypes; if you've never used JavaScript before, you can think of these like instances of a class in Python. Prototypes have both attributes and methods and are accessed in JavaScript like they are in Python.

Syntax:

Referencing a specific spawn through a variable:

spawn = Game.spawns.Spawn1

Moving a Creep:

creep = Game.creeps['upgrader123']
creep.moveTo(creep.room.controller)
PreviousOptional ArgumentsNextObjects - Creation and the Keyword "new"

Last updated 4 years ago

Was this helpful?