+
Skip to content

alexhyang/screeps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screeps Notes

Concepts

  1. creeps

    1. skills based on part types
      • WORK, MOVE, CARRY
      • ATTACK, RANGED_ATTACK, HEAL
      • CLAIM, TOUGH
  2. room

    1. controller (claim control of the room, HQ of the room)

GamePlay

  1. tasks

    // spawning creeps
    Game.spawns['Spawn1'].spawnCreep( [WORK, CARRY, MOVE], 'Harvester1' );
    Game.spawns['Spawn1'].spawnCreep( [WORK, CARRY, MOVE], 'Upgrader1' );
    Game.spawns['Spawn1'].spawnCreep( [WORK, CARRY, MOVE], 'Builder1',
        { memory: { role: 'builder' }}
    );
    Game.spawns['Spawn1'].spawnCreep( [WORK,WORK,WORK,WORK,CARRY,MOVE,MOVE],
        'HarvesterBig', { memory: { role: 'harvester' } }
    );
    
    // storage
    Game.rooms[roomName].energyAvailable;
    Game.rooms[roomName].energyCapacityAvailable;
    Game.structure[hashCode].store.getCapacity(RESOURCE_ENERGY);
    Game.structure[hashCode].store.getUsedCapacity(RESOURCE_ENERGY);
    
    // construction and resource finding
    //   harvester: spawns + extensions > containers
    //   builders & repairers: containers > spawn > source
    //   upgraders: containers > source
    
    // activate the safe mode
    Game.spawns['Spawn1'].room.controller.activateSafeMode();
    
    // create construction site
    Game.spawns['Spawn1'].room.createConstructionSite( 23, 22, STRUCTURE_TOWER );
    
    // change role of creep
    Game.creeps[creepName].memory = { role: myRole }

Scripts

  1. module import diagram

    module import diagram

References

  1. screeps docs
  2. API

About

My gameplay scripts for Screeps

Resources

Stars

Watchers

Forks

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载