Behind closed

Talk about making games.

Behind closed

Postby Behdadsoft » Thu Sep 12, 2013 2:22 pm

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.
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: Behind closed

Postby schnellboot » Thu Sep 12, 2013 2:44 pm

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
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Behind closed

Postby Behdadsoft » Thu Sep 12, 2013 3:40 pm

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
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: Behind closed

Postby RippeR7420 » Thu Sep 12, 2013 5:04 pm

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);
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Re: Behind closed

Postby Behdadsoft » Thu Sep 12, 2013 5:16 pm

no, this code can't move the view.
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron