Page 1 of 1

Behind closed

PostPosted: Thu Sep 12, 2013 2:22 pm
by Behdadsoft
Hi.

I used this code according making the view follow an actor tutorial in game editor:

Code: Select all
int weight = 8;
x = ((weight - 1)*x +Player.x)/weight;


But I want Player can not go back and Behind closed.(Like NES Contra Game) I don't Know how can do it.

Please Guide Me.

Re: Behind closed

PostPosted: Thu Sep 12, 2013 2:44 pm
by schnellboot
i dont know contra but is the view movement like mario?
if so
Code: Select all
int weight = 8;
int X = ((weight - 1)*x +Player.x)/weight;
if(X>x)x=X;


and to block the player i have to see the player movement code

Re: Behind closed

PostPosted: Thu Sep 12, 2013 3:40 pm
by Behdadsoft
i dont know contra but is the view movement like mario?

Yes, Thanks schnellboot. :D
1+
can you Explanation this code?
Code: Select all
((weight - 1)*x +Player.x)/weight;


Thanks

Re: Behind closed

PostPosted: Thu Sep 12, 2013 5:04 pm
by RippeR7420
The block the player from going back past the view couldn't you just use something like this?

Player->draw actor-> script editor->
Code: Select all
player.x=min(player.x, view.x);

Re: Behind closed

PostPosted: Thu Sep 12, 2013 5:16 pm
by Behdadsoft
no, this code can't move the view.