# Game development 2 level 30

**URL:** <https://discourse.codecombat.com/t/game-development-2-level-30/35908>\
**Category:** Level Help\
**Created:** [August 12, 2023, 2:26am UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908 "2023-08-12T02:26:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![VasishtG7](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@VasishtG7](https://discourse.codecombat.com/u/VasishtG7)\
**Post date:** [August 12, 2023, 2:26am UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/1 "2023-08-12T02:26:42Z")

</div>

Hi, I have coded something but am not able to move the character. Please have a look at it and give some feedback. Thanks in advance.

# Create your own game!

GAME\_DURATION = 60

# Spawn a player with spawnPlayerXY()

player = game.spawnXY(“knight”, 36, 30)  
game.spawnXY(“gold-coin”, 51, 58)  
player.maxSpeed = 50  
player.maxHealth = 1000  
player.maxAttackDamage = 100

# Add at least one goal!

game.addDefeatGoal()

if game.defeated == 5:  
game.setGoalState(DefeatGoal, True)

# Spawn objects into the game with spawnXY()

game.spawnMaze(“forest”, 9)  
game.spawnXY(“generator”, 60, 12)  
“generator”.spawntype == “scout”

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [August 12, 2023, 5:38am UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/2 "2023-08-12T05:38:47Z")

</div>

Welcome to the forum! This is a family-friendly place where coders can share bugs, ask for help on any CodeCombat level (don’t forget to post your [code correctly](https://discourse.codecombat.com/t/essentials-how-to-post-format-your-code-correctly/15521?u)), or just hang out with other coders. But before you proceed, please check out our guidelines: [this topic.](https://discourse.codecombat.com/t/this-topic/15601)  
Have a great time! 🥳  
Can you please format your code correctly by clicking the gear button and the \</\> button. Those who can help you will be able to read your code easier. Thanks!!

---

<div class="post-metadata">

**Author:** ![ChickenMaster](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chickenmaster/32/35104_2.png) [@ChickenMaster](https://discourse.codecombat.com/u/ChickenMaster)\
**Post date:** [October 1, 2023, 5:26pm UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/3 "2023-10-01T17:26:37Z")

</div>

Are you still here? @VasishtG7 ?

---

<div class="post-metadata">

**Author:** ![ChickenMaster](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chickenmaster/32/35104_2.png) [@ChickenMaster](https://discourse.codecombat.com/u/ChickenMaster)\
**Post date:** [October 1, 2023, 5:26pm UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/4 "2023-10-01T17:26:52Z")

</div>

If so I will help you.

---

<div class="post-metadata">

**Author:** ![ChickenMaster](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chickenmaster/32/35104_2.png) [@ChickenMaster](https://discourse.codecombat.com/u/ChickenMaster)\
**Post date:** [October 1, 2023, 7:40pm UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/5 "2023-10-01T19:40:56Z")

</div>

# Create your own game!

GAME\_DURATION = 60

# Spawn a player with spawnPlayerXY()

player = game.spawnPlayerXY(“knight”, 36, 30)  
game.spawnXY(“gold-coin”, 51, 58)  
player.maxSpeed = 50  
player.maxHealth = 1000  
player.maxAttackDamage = 100

# Add at least one goal!

game.addDefeatGoal()

if game.defeated == 5:  
game.setGoalState(DefeatGoal, True)

# Spawn objects into the game with spawnXY()

game.spawnMaze(“forest”, 9)  
game.spawnXY(“generator”, 60, 12)  
“generator”.spawntype == “scout”

Try this code

---

<div class="post-metadata">

**Author:** ![VasishtG7](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@VasishtG7](https://discourse.codecombat.com/u/VasishtG7)\
**Post date:** [October 1, 2023, 11:43pm UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/6 "2023-10-01T23:43:13Z")

</div>

Hi, I have solved the code, I will try to improve it using this code  
Thx

---

<div class="post-metadata">

**Author:** ![ChickenMaster](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chickenmaster/32/35104_2.png) [@ChickenMaster](https://discourse.codecombat.com/u/ChickenMaster)\
**Post date:** [October 2, 2023, 6:46pm UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/7 "2023-10-02T18:46:57Z")

</div>

Could I see your game? I would love to try it! If so put it here! I (hopefully) can’t wait to try it!

> [@Contest for best game development project!](https://discourse.codecombat.com/t/contest-for-best-game-development-project/35959):
>
> Post your best game development project here! I will review them all and announce the best one!

---

<div class="post-metadata">

**Author:** ![VasishtG7](https://avatars.discourse-cdn.com/v4/letter/v/7ba0ec/32.png) [@VasishtG7](https://discourse.codecombat.com/u/VasishtG7)\
**Post date:** [October 2, 2023, 11:43pm UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/8 "2023-10-02T23:43:01Z")

</div>

Ok but it is not that good so is it okay if I try to use some of the techniques that u mentioned before showing it to you?

---

<div class="post-metadata">

**Author:** ![ChickenMaster](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chickenmaster/32/35104_2.png) [@ChickenMaster](https://discourse.codecombat.com/u/ChickenMaster)\
**Post date:** [October 3, 2023, 4:46pm UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/9 "2023-10-03T16:46:53Z")

</div>

Sure!!!(20 charsssssssssssssss)

---

<div class="post-metadata">

**Author:** ![ChickenMaster](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chickenmaster/32/35104_2.png) [@ChickenMaster](https://discourse.codecombat.com/u/ChickenMaster)\
**Post date:** [December 18, 2023, 10:44pm UTC](https://discourse.codecombat.com/t/game-development-2-level-30/35908/10 "2023-12-18T22:44:05Z")

</div>

Do you have it now???
