Page 1 of 1

moveto not working with variables

PostPosted: Fri Feb 01, 2008 3:56 pm
by j2graves
if I have a door that leads to another part of the game and I have it set so that when

collision on any side of door

Code: Select all
door_open = 1;


keydown a

Code: Select all
if(door_open==1)
moveto wherever;
door_open = 0;


once I press the a key... well I won't fully describe the chaos that follows, but no matter the code that has the moveto dependent on a variable, the event actor just moves back to where it was created! how do I get this to work?

Re: moveto not working with variables

PostPosted: Fri Feb 01, 2008 4:30 pm
by makslane
There is no problem with the MoveTo function.
Look the attached file.

The variable canmove is 1 when the space key is pressed.
You can click in the screen to move the player, but the player only will move if canmove = 1;

Re: moveto not working with variables

PostPosted: Fri Feb 01, 2008 4:32 pm
by j2graves
thanx!

Re: moveto not working with variables

PostPosted: Fri Feb 01, 2008 4:41 pm
by Kalladdolf
oh, did you use moveto of MoveTo?
there's a difference... :)

confusing, I know :roll:

Re: moveto not working with variables

PostPosted: Fri Feb 08, 2008 8:08 pm
by j2graves
allow me to describe fully the chaos

1; the most common glitch. player moves in front of door, press key, view moves to new location, coin sound effect plays repeatedly, player is destroyed, recreated and moves back to the position that he was created.

2; happened most ricently. player moves in front of door, press key, EVERYTHING IN THE GAME EXCEPT THE PLAYER, THE VIEW AND THE BACKGROUND DISAPPEARS!!!!!!!!!!!!!!!!!!!!!

Re: moveto not working with variables

PostPosted: Sat Feb 09, 2008 5:14 am
by Bee-Ant
==Kalladdolf== wrote:confusing, I know :roll:

:roll: