Xojo Wars: The XDC Code Competition

An email went out to XDC attendees this morning announcing our annual XDC code competition: Xojo Wars! I thought I’d start a thread in case you all would like to discuss or ask questions. In case you missed the email or aren’t coming to XDC and want to check out the project, you can access your battle instructions here: https://github.com/xojo/XojoWars

I just submitted a pull request on GitHub with a minor fix to the paths of the Graphics and Sounds folders.

(Otherwise Xojo 2015r2 asks to locate the folders/directories.)

Ugh I wish I had time to go this year! This looks so much fun!

I found a minor bug in XojoWars. at the end of the game, it displays the winner of the last battle as the winner of the game over the actual winner of the game. its a small thing but could be fixed before FRI’s match.


That’s not a bug.

From the readme:

Can someone give me an example what we need to configure for the the following methods:


I found out without doing any changes, my ship can fly and fire missiles on its own, so I am confuse what I need to add to make it smarter? Thanks.


You will have to examine that the enemies around you. In the Rotate interface method you get passed a number of parameters that can help you determine what to do. The Enemies array will give you the Enemy # (not count but an identifier), Direction, Position (X, Y), and Missile info (if any) of the enemy ship.

You might want to do a quick calculation to see if an enemy is ‘front’ of you. If so, what is the distant from you to the enemy. Since there is a limit to how far your shots will go, perhaps only fire if the distance is under some value. You can tell the ship to rotate left or right or keep going straight in this method.

Likewise, in the Teleport interface method you can tell the ship to teleport. Again, perhaps you get the distance away from enemy ships (from the rotate method), see if any ships are pointing at you, and then if they are within a certain distance and the missile is ‘coming at you’ perhaps you should teleport.

I gave all this considerable thought a few weeks ago but I’ve been swamped with work. I won’t be participating. :frowning:

Well, if there is a sample code of ship movement and enemy detection then it would be easier to know what I need to implement. When I hit run, it seems to be moving and firing at will, so don’t really have any idea on what kind of logic that need to implement. Thanks.

Are you referring to a new ship you have created? The project includes several sample ships you can look at as well.

Make sure you refer to the readme on the game site: https://github.com/xojo/XojoWars

Yes, I am referring to the new ship that I am suppose to implemented. But basically, it can move, rotate, fire at enemy ships, so I am kind of confuse what else it need to do (code). Well, unless I miss a lot of details, did read the readme from front to the back, but without spending much time on the XojoWars coding, I guess it’s hard to know what I suppose to do. Thanks.

Like Bob mentioned, you’ll probably want code to track other ships so that you can determine where your ship should go and when it should shoot.

It’s a contest so the point of it is to figure it out! My only partial design was using trigonometry to calculate angles and distances to the black holes and other ships.

UGH! I implemented an A* algorithm this past summer in Xojo that would have allowed me to actually contend this year :slight_smile: :slight_smile: Good luck guys!