Page 2 of 2

Re: Top down shooter (4 way shooting problem)

PostPosted: Sat Mar 24, 2012 1:20 am
by Johnno
ok so that works!!!

No doubt I'll be back with more questions!

Thanks so more for the feedback and help so far skydereign. Once I'm finish this demo I'll post a tutoral of it, just as a way of thanking the forum.

Next on my list of helps is I have a count down timer which I want to stop at a check point, then I want to multiply that time by say 10 and add it to the score.
I already have a countdown and score working for pickups, bonuses etc. I'll search the forum for a solution before I come back for help.

Re: Top down shooter (4 way shooting problem)

PostPosted: Tue Mar 27, 2012 3:23 am
by Johnno
I've got a few problems that need to be fixed.

1. I'm using the Moveto function to move the View to the score page. Depending on where my player is when he hits the Collision sprite, my move is to a different location every time (buy about 10-15 pixels). I'm guess it's something to do with the "Relative to" option. Is there another way to move the View to an precise location?
Exit the level from different locations and see whats happening!

2. The score page works, but I can't get the XP values and load them to the next level. I added the values to a Variable called xp but it ended up looping and the xp score just kept on increasing!
Example: (time x 10) + (ammo(clip) x 100) + (xp from completed level) = new xp score at the start of level 2. I'm guessing I need to stop the Draw Actor from the first level?

I ended up using the following code but it's just a stop gap for me to see that it sort of works.

xp_bonus, Draw Actor, Script
Code: Select all
sprintf(text, "%02d", VirtSec*10 +  clip*100 + xp);


Keys.
arrows - move
space - shoot, go on you know you want to!
The Deck Lift (red circle ) will take you to the score page. Don't forget to pick up the Ammo and Med Pack! - I can't take any credit for the map artwork, Amiga fans will recognize it!

Re: Top down shooter (4 way shooting problem)

PostPosted: Tue Mar 27, 2012 3:55 am
by Johnno
Ok I ended up creating another variable called xp2. Which now doesn't cause the looping problem, which I can use for the next level - yay!

I still have a problem with the MoveTo issue.

Re: Top down shooter (4 way shooting problem)

PostPosted: Tue Mar 27, 2012 5:39 am
by Johnno
I tried using..

view.x = 960;
view.y = -420;

still doing the same thing

Re: Top down shooter (4 way shooting problem)

PostPosted: Fri Mar 30, 2012 2:16 am
by Antxion
Thats Awesome Johnno

Im going to use that code on my game
+1

Re: Top down shooter (4 way shooting problem)

PostPosted: Fri Mar 30, 2012 6:47 am
by skydereign
Sorry for the delay, have been busy with finals. Anyway, the problem is that the view's position is relative to the player. To fix this (seeing as you are destroying the player anyways) is to unparent the view. I wouldn't suggest using MoveTo for that anyways.
Code: Select all
ChangeParent("view", "(none)");
view.x=score_bk.x-view.width/2;
view.y=score_bk.y-view.height/2;

Re: Top down shooter (4 way shooting problem)

PostPosted: Fri Mar 30, 2012 11:35 am
by Johnno
Oh so simple but so effective.

I'd given up on it (till now) and had moved to something else.

Thanks. :D