Help with background view

Talk about making games.

Postby ShingingDB » Tue Apr 03, 2007 9:30 pm

makslane wrote:You can put a collision event in the centerView actor.
How you move the centerView?


Uhh using this script.
Draw Actor -> Script Editor

int weight = 10;
x = ((weight -1)*x + player.x)/weight;
y = ((weight -1)*y + player.y)/weight;

Where I move the view follows my actor.
ShingingDB
 
Posts: 43
Joined: Sun Apr 01, 2007 1:31 am
Score: 0 Give a positive score

Postby makslane » Tue Apr 03, 2007 11:14 pm

Create two actors stopLeft and stopRight.
After your code, put this:

Code: Select all
if(x < stopLeft.x) x = stopLeft.x;
else if(x > stopRight.x) x = stopRight.x;


Don't need to use the collision event.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ShingingDB » Wed Apr 04, 2007 11:27 pm

makslane wrote:Create two actors stopLeft and stopRight.
After your code, put this:

Code: Select all
if(x < stopLeft.x) x = stopLeft.x;
else if(x > stopRight.x) x = stopRight.x;


Don't need to use the collision event.


Would the stopLeft and stopRight have to be a filled region or wired region?
ShingingDB
 
Posts: 43
Joined: Sun Apr 01, 2007 1:31 am
Score: 0 Give a positive score

Postby makslane » Wed Apr 04, 2007 11:48 pm

Will works with any actor.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ShingingDB » Thu Apr 05, 2007 6:04 pm

Dammit it still doesnt work...
ShingingDB
 
Posts: 43
Joined: Sun Apr 01, 2007 1:31 am
Score: 0 Give a positive score

Postby makslane » Thu Apr 05, 2007 6:11 pm

Please, create a simple ged only with your centerView actor, the stop actors, the background, the player and the actions need to make the movements. Post the file here and I will take a look.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ShingingDB » Thu Apr 05, 2007 6:34 pm

There ya go
Attachments
game.zip
Game
(890.52 KiB) Downloaded 127 times
ShingingDB
 
Posts: 43
Joined: Sun Apr 01, 2007 1:31 am
Score: 0 Give a positive score

Previous

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron