# Dragon game

**URL:** https://forum.kirupa.com/t/dragon-game/206125
**Category:** flash
**Created:** [November 5, 2006, 4:42pm UTC](https://forum.kirupa.com/t/dragon-game/206125 "2006-11-05T16:42:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Desann](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@Desann](https://forum.kirupa.com/u/Desann)
#### Post date: [November 5, 2006, 4:42pm UTC](https://forum.kirupa.com/t/dragon-game/206125/1 "2006-11-05T16:42:12Z")

</div>

Hi, I’m pretty new to flash, I’ve just been going through that dragon game tutorial and I have a couple of questions.

Basically I downloaded the flash file with the arms legs and arrow stuff already in the library and used this as my final code:

//---- variables ---- var steps:Number = 5; var spriteX:Number = 265; var spriteY:Number = 265; var speed:Number = 25; var arrowActive:Boolean = false; var dragons:Number = 3; var i:Number = 0; var score:Number = 0; //---- properties ---- knight.swapDepths(10); //---- functions ---- function checkKeys() { if (Key.isDown(Key.RIGHT) && spriteX\<510) { spriteX += steps; knight.legs.play(); } else if (Key.isDown(Key.LEFT) && spriteX\>40) { spriteX -= steps; knight.legs.play(); } if (Key.isDown(Key.UP) && arrowActive == false) { knight.arms.play(); attachMovie(“arrow”, “arrows”, 8); arrows.\_x = spriteX; arrows.\_y = spriteY+50; //arrowActive = true } } function updatePawel() { knight.\_x = spriteX; knight.\_y = spriteY; } function updateArrow() { if (arrowActive == true) { arrows.\_y -= speed; } if (arrows.\_y\<-10) { arrowActive = false; removeMovieClip(arrows); } } function initDragons() { for (i; i\<dragons; i++) { attachMovie(“dragon”, “dragon”+i, i); dragon = \_root[“dragon”+i]; updateDragons(dragon); dragon.onEnterFrame = function() { if (this.hitTest(arrows)) { score += 5; trace(score); arrowActive = false; removeMovieClip(arrows); updateDragons(this); } if (this.\_x\>0) { this.\_x -= this.velo; } else { updateDragons(this); } }; } } initDragons(); function updateDragons(which) { which.\_x = random(100)+530; which.\_y = random(80)+20; which.velo = random(10)+2; } this.onEnterFrame = function() { checkKeys(); updatePawel(); updateArrow(); }; Thats all working fine :thumb: except the score display, rather than been shown at the top corner like in the demo version, Its coming up in a separate output box at the bottom of the screen. Does anyone know how to change that?

Also (Lol and this is gona sound like a really stupid question I know :look:) Im having a bit of trouble putting a background in. I’m using a wallpaper, with a picture of a castle, and I’ve set it up in its own layer and everything. But no matter what I do, its covering the Knight and the dragons when I put it on the stage. I’ve tried left clicking it and setting it to the back and everything, nothing works. Does anyone know what I’m doing wrong?

Thanks a lot :thumb:
