Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / a new problem with my mobs, 2D

Author
Message
Pepzi
13
Years of Service
User Offline
Joined: 22nd Feb 2011
Location:
Posted: 3rd Nov 2011 16:52
Hi, me again, another problem, wishing to be saved. Else I'm doomed.

I have this problem with my mobs, it's that when I directly load a higher stage, my mobs' images are fine.

BUT when I start on my first stage my mob's image becomes a platform image of a previous stage!

It still moves the way I assigned to it.

I'm sure I have my image numbers set correct and unique so I have no idea now why is this happening...

New to darkbasic
Pepzi
13
Years of Service
User Offline
Joined: 22nd Feb 2011
Location:
Posted: 3rd Nov 2011 16:53
PS: As well as the other mobs on the higher stage!!

New to darkbasic
Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 3rd Nov 2011 18:34
You probably just have to clear the arrays before loading your next level... so nothing from the previous level is carried over to the next.

Pepzi
13
Years of Service
User Offline
Joined: 22nd Feb 2011
Location:
Posted: 4th Nov 2011 06:02
Thanks sir grog but how do I do it right, because I've tried undim, empty array and even delete image delete sprite, non of them worked for me. If you could please check the codes attached

New to darkbasic

Attachments

Login to view attachments
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 4th Nov 2011 10:23 Edited at: 4th Nov 2011 10:29
Hi Pepzi, sorry for my delayed response, I've been quite busy.

I think I found the problem. At line 390 (of the version you sent me) you have this:



Then in your subroutine Sub3Stage2 you load another subroutine called orcwar1Vars. In that subroutine you have this:


I think you have crossed image numbers so the solution is to give either the Sub1PlatformId(s) or orcwar1imgnum different values. It would probably be best to change orcwar1imgnum but be careful. Something you change here may change something somewhere else. I suggest using the IMAGE EXIST() and SPRITE EXIST() commands to check that it hasn't been used yet.

Hope that helps.

Edit - Yep, I think that's the problem. After changing a few numbers around I got this after playing the first 3 levels.



Attachments

Login to view attachments
Pepzi
13
Years of Service
User Offline
Joined: 22nd Feb 2011
Location:
Posted: 4th Nov 2011 13:57
That solved the problem!! Thank you so much!! Thank you!

New to darkbasic

Login to post a reply

Server time is: 2024-05-20 06:41:29
Your offset time is: 2024-05-20 06:41:29