[Adventurer] Adventure Time

The level Adventure Time is ready for testing.

It takes place in the Game Dev 2 campaign, and demonstrates spawning enemies over time using game.time.

1 Like

This is a great and simple level which allows users to see the code. I like it.

I am sad that I only got 10XP and no gems.

Only for subscribers?

Adventurer levels are usually ā€œfreeā€, at least until they go publicā€¦

We de-adventurer-ed a bunch of Game Dev levels recently, and this one got caught up in the sweep. It should be fixed now, and available for testing.

no issues, nice level

Are you sure? I got some gemsā€¦

@Catsync

Either way, I think itā€™s a great level for beginners!

I think it is fun, though i got little gems :anguished:

Unfortunately, no matter which way I tried, the guardian wouldnā€™t attack the munchkins. The code to attack the munchkins was already in place when I loaded the level, so perhaps itā€™s a bug? Iā€™m doing the Python version, and this is the code Iā€™m talking about.

def onSpawn(event):
    while True:
        unit = event.target
        enemy = unit.findNearestEnemy()
        if enemy:
            unit.attack(enemy)

game.setActionFor("munchkin", "spawn", onSpawn)

I couldnā€™t pass the level because even though the code looks correct, the guardian wouldnā€™t attack the munchkins. The other aspect, which is the spawning of the munchkins, worked just fine. Maybe itā€™s a bug? All the previous levels worked fine.

Howdy and welcome to the forum!

Actually, you donā€™t need attack code in the game devsā€¦just click on the munchkin and your guardian will attack.

Thanks for your help! It worked when I clicked on them. Maybe Iā€™m just dumb. However, the code I referred to above doesnā€™t seem to hint at needing to click them; it appears as if it should automatically attack them. Maybe Iā€™m reading the code wrong? Iā€™m a beginner after all.

1 Like

You are quite welcome! Honestly, I donā€™t remember if/where it was ever stated. However, think of the game dev levels as where you code for the playerā€¦what are they going to do when they attempt to play your ā€˜gameā€™? They are going to start clicking everything, arenā€™t they :wink:

I think your code was good, that which you posted above, just a little misplacedā€¦you are not the only one to get thrown off track by not needing to design attack code. Besides, every single one of us was a beginner at some point too :slight_smile: