Skip to content

baksale/salesforce-battle

Repository files navigation

Salesforce Battle

Practice 💪 your Salesforce Platform skills by implementing move and shoot algorithms for your tank.
Win a league and become a champion 🏆.

The concept is taken from a popular Robocode game.

Mission

Get familiar with many Salesforce Platform Apex capabilities via playing the game with other Trailblazers (kudo to Trailhead).

How does it work?

  1. The battle happens on a field (e.g. a square 10x10)
  2. At the beginning, tanks are placed randomly onto the field
  3. On every round 2 things happen:
    1. tanks move
    2. tanks attack other tanks
  4. Tanks with no lifes left are removed from the field
  5. The winner is the only tank left after the last round

Move

Tanks notify engine about their desired move via ApexTankBase.cls#nextMoveDirection method.

Tanks can make 5 decisions for the next round move:

  1. UP
  2. RIGHT
  3. DOWN
  4. LEFT
  5. NOMOVE

Tanks movements happen during every round move phase:

  1. Engine iterates over alive tanks in random order
  2. Tank is moved in the chosen direction
  3. The move fails and the tank remains in the current location:
    1. if there is another tank in the target field already
    2. if there is no field in the target direction

Every tank has access to Radar to implement its move tactics:

Point coordinateFor(ApexTank tank);
Boolean pathExists(Point relativePoint, MoveDirectionEnum direction);

Attack

Tanks notify engine via ApexTankBase.cls#pointToAttack method about their attack coordinate for the next round.
Radar methods allow to implement attack strategy:

List<Point> getCoordinatesWithTanks();
ApexTank tankAt(Point point);

Where to start?

Take a look at CONTRIBUTING.md or raise an issue in this repository.

Roadmap

Leagues

Leagues will be focusing on different aspects of the platform

  • Apex League
    basic apex knowledge(loops, variables, data structures)
  • Limits
    consume the smallest amount of the platform resources
  • Teams
    communicate between tanks to win as a team
  • Flows
    implement move tactics or shoot strategy via flows
  • ...

Leaderboard

Use Digital Experience, Reporting, Guest Profile, Contact, Opportunity, etc. platform capabilities to build leaderboard where everyone can see the results.

Visualization

Implement custom UI via visualforce page or lwc to replay battles visually.

About

Battle Engine to compete using Salesforce Platform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages