# Totally Screwed up! =(

**URL:** <https://forum.kirupa.com/t/totally-screwed-up/184543>\
**Category:** programming\
**Created:** [April 5, 2006, 8:02pm UTC](https://forum.kirupa.com/t/totally-screwed-up/184543 "2006-04-05T20:02:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 5, 2006, 8:02pm UTC](https://forum.kirupa.com/t/totally-screwed-up/184543/1 "2006-04-05T20:02:58Z")

</div>

heya =(

i totally screwed up with my “rpg” project i would like to ask if theres anyone that could take a look at it and maybe fix it a little

if u would i’dd love it 😃

what i tried was:

- Inventory system
- health system on monster and player (when 0 play frame of died)
- battle system (if click on a weapon see frame of u with weapon, if weapon touch monster get the damage)
- weapon system (every weapon has own damage \_root.weapon1 ect ect and random 10, 20 , 30 ect)

and final a kind of “teleport system” if u touch a edge of the map u get to the other side of it

Srry file was to big so had to upload on rapidshare and ultrashare

\*\*[FONT=Verdana][SIZE=2][http://www.ultrashare.de/f/3472/Beta\_V\_0.0.6.fla](http://www.ultrashare.de/f/3472/Beta_V_0.0.6.fla)

[/SIZE][/FONT]\*\*[http://rapidshare.de/files/17289384/Beta\_V\_0.0.6.fla.html](http://rapidshare.de/files/17289384/Beta_V_0.0.6.fla.html)

if anyone can for me idd love that and ill give you credits for it  
a pretty famous Dutch website is waiting on my "rpg"game so ull get credits for it then 🙂 ’

Thnx,

Regards,  
Ricer

---

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 5, 2006, 8:25pm UTC](https://forum.kirupa.com/t/totally-screwed-up/184543/2 "2006-04-05T20:25:42Z")

</div>

If you don’t mind I’d like to use some of your code with my game, if it works out. I’ll try and fix it either way though.

Well for the ‘teleport’ system, I found that to be the easiest part of fixing it. It’s just:

if (this.\_x \> 0 + this.width)  
{  
this.\_x = StageWidth-this.width;  
}

and then do that 4 times but change it for each side.

Now for the other parts…

Ah, ok. So death… Ah I love that word ‘Death’. :cowbell:

if (\_root.health \> 0)  
{  
this.gotoAndPlay(Frame number that is death);  
}

Now onto the next thing…

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 5, 2006, 8:30pm UTC](https://forum.kirupa.com/t/totally-screwed-up/184543/3 "2006-04-05T20:30:18Z")

</div>

sure go ahead 🙂

if u can fix my “mess” idd love you then! 😃

^^

---

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 5, 2006, 8:36pm UTC](https://forum.kirupa.com/t/totally-screwed-up/184543/4 "2006-04-05T20:36:43Z")

</div>

> [@ricer](#):
>
> sure go ahead 🙂  
> if u can fix my “mess” idd love you then! 😃  
> ^^

Srry. I’m into that stuff man, I’m straight as a pencil. lol. :diss:

Ok so. :

for ascii code go here: it’s in Dec not [http://www.danbbs.dk/~erikoest/asciicc.htm](http://www.danbbs.dk/~erikoest/asciicc.htm)

if (Key.isDown(49))  
{  
for (i = 4;i \> 5; i++)

For each slot in the inventory check what’s in there  
I don’t know where you store the data of what’s in which slot. And if you don’t have that data stored you should store it in an array. Look it up, after lunch I’ll be glad to explain it if you havn’t already figured it out.  
//Now check if there is a sword in one of these slots. If so then remove the item from the slot and then do this:  
this.gotoAndPlay(frame with sword);  
}

do that until all the weapons have thier own keys.

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 5, 2006, 8:43pm UTC](https://forum.kirupa.com/t/totally-screwed-up/184543/5 "2006-04-05T20:43:54Z")

</div>

i got that,

but if i do the moving\_mc will walk but the sword stays on the ground 😛

---

<div class="post-metadata">

**Author:** ![woad](https://avatars.discourse-cdn.com/v4/letter/w/34f0e0/32.png) [@woad](https://forum.kirupa.com/u/woad)\
**Post date:** [April 5, 2006, 8:57pm UTC](https://forum.kirupa.com/t/totally-screwed-up/184543/6 "2006-04-05T20:57:14Z")

</div>

Right, what you might want to do is make it so when the character moves you make the weapon move too. So:

currentweapon = whatever weapon you are now wielding  
currentweapon.\_y = moving\_mc.\_y + 5;  
currentweapon.\_x = moving\_mc.\_x - 10;  
if (key.isDown(Key.DOWN))  
{  
moving\_mc.\_y += 5;  
currentweapon.\_y += 5;  
}

I’ll try doing the weapons.

function InitializeWeapons()  
{  
Sword.minDamage = math.Random(10);  
Sword.maxDamage = math.Random(20);  
Pike.minDamage = math.Random(20);  
Pike.maxDamage = math.Random(30);  
}

and so on and so forth, just make the min and maxdamage variables inside the IntializeWeapons.

As for the hitting:

if (Key.isDown(Key.SPACE) && Wielding == true)  
{  
if (curentweapon == sword)  
{  
this.gotoAndPlay(whatever frame is attack)  
if (\_root.moving\_mc.sword.hitTest(Baddy))  
{  
Baddy.health -= 10;  
}  
}  
}

Edit: After playing the game again there’s something wierd going on when you die. After you hit -1 your Status becomes healing and you go up to 5 health and then when you restart you go back down to -1 or 0 or 1

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 6, 2006, 6:02am UTC](https://forum.kirupa.com/t/totally-screwed-up/184543/7 "2006-04-06T06:02:53Z")

</div>

oh lol :S well thats probbly one of the “messed” things 😛

thnx for telling 🙂

and thnx for the script ill give it a try

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 6, 2006, 6:25am UTC](https://forum.kirupa.com/t/totally-screwed-up/184543/8 "2006-04-06T06:25:03Z")

</div>

i fixed a little for u 🙂

```auto
 currentweapon = whatever weapon you are now wielding
 currentweapon._y = moving_mc._y + 5;
 currentweapon._x = moving_mc._x - 10;
 if (key.isDown(Key.DOWN))
 {
 moving_mc._y += 5;
 currentweapon._y += 5;
 }

```

change into

```auto
onClipEvent (load) {
    currentweapon = _root.sword;
    currentweapon._y = moving_mc._y+5;
    currentweapon._x = moving_mc._x-10;
    if (key.isDown(Key.DOWN)) {
        moving_mc._y += 5;
        currentweapon._y += 5;
    }
}

```
