Hello world – Introduction to my Game!

Quick intro to who I am and my indie game Crash

Hey everyone! My name is Ajay Venkat I am a programmer living in Australia. I am currently developing a video game called Crash which is a RTS battle game where you can command hundreds of units through code!

This is what the arena looks like.

The objective is simple, you have to destroy the enemy base. To play all you have to do is open up any of your favourite code editors, open up a Python file and import a module called crash and you’re off!

An example of the type of code you can write:

from crash import *
import math

kill = True

async def kill_in_5():
    global kill
    await seconds(5)
    kill = False

async def move_weird(archer: Archer):
    global kill
    
    while kill:
        x = math.cos(game.clock.game_time*5) 
        y = math.sin(game.clock.game_time*5) 
        archer.move(x,y)
        await ticks(2)

async def begin_attack(game: Game, u: Unit):
    while True:
        u = u.as_soldier()
        enemy_len = len(game.unit_manager.alive_enemies())
        print("Enemies : " + str(enemy_len), end='\r')
        if enemy_len > 0:
            e = game.unit_manager.closest_enemy(u)
            while not e.dead:
                #print(e.unit_id)
                pos = e.position
                u.move_to(pos.x, pos.z)
                await until(lambda : u.position.distance_to(pos) < u.attack_range or e.dead)
                u.attack(pos)
                await until(lambda : u.attack_timeout <= 0 or e.dead)
        else:
            u.stop_movement()
            print("All enemies destroyed, go in circles...", end='\r')
            await move_weird(game, u)
            await tick()
            break

def start(game : Game):
    for i, u in enumerate(game.unit_manager.units_of_type(Soldier)):
        game.run_background(begin_attack(game, u))
    for i, u in enumerate(game.unit_manager.units_of_type(Archer)):
        game.run_background(move_weird(game, u))
    pass

def infinite(game : Game):    
    pass

def finish(game: Game):
    print("Game has finished", end='\r')
    game.unit_manager.stop_all_units()
    pass

start_game(start, infinite, finish)

When you hit play, this will auto-connect to the game client and start executing your code against your enemies.

The current supported game mode is Sandbox however I aim to support Multiplayer in the coming months.

There is a lot to explain about how all of this works, and I’m really excited to finally start sharing about the game. I will also be posting development logs regularly on my YouTube Channel.

I am starting to build a community so I will be posting a Discord channel soon, everyone is welcome to come test and play the game with me once I finish the development of multiplayer!

See you next time!

realtime-battle

Never miss a thing.

Connect your email list so you can start gathering emails. It is a great way to grow your audience into lifelong subscribers.

View more articles
  • Porting my Unity Game to Web

    Porting my Unity Game to Web

    I’ve been working on a programming game where you are able to code units to move around and complete objectives such as fighting enemies, capturing objectives etc. When I initially started the project it was aimed to be a Desktop Game where you could write code in Python, however as the project evolved I started…

  • Starting Multiplayer Development

    Starting Multiplayer Development

    Today marks the day I begin implementing multiplayer with my game Crash. If you want to learn more about the game I’m making take a look at Introduction to Crash, but essentially it’s a realtime strategy game where you can code units yourself using Python to fight other programmers. Up until now I have been…

  • Realtime Coding Strategy Features

    Realtime Coding Strategy Features

    Hey everyone! I’ve been busy recently working on a really set of features that will enhance the ability for players to change up their strategy in my coding realtime strategy game Crash. For those who are new, I am making a realtime strategy game where you can control your soldiers directly using Python code to…