moveto not working with variables

Non-platform specific questions.

moveto not working with variables

Postby j2graves » Fri Feb 01, 2008 3:56 pm

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?
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: moveto not working with variables

Postby makslane » Fri Feb 01, 2008 4:30 pm

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;
Attachments
MoveTo.zip
(172.22 KiB) Downloaded 82 times
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: moveto not working with variables

Postby j2graves » Fri Feb 01, 2008 4:32 pm

thanx!
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: moveto not working with variables

Postby Kalladdolf » Fri Feb 01, 2008 4:41 pm

oh, did you use moveto of MoveTo?
there's a difference... :)

confusing, I know :roll:
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: moveto not working with variables

Postby j2graves » Fri Feb 08, 2008 8:08 pm

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!!!!!!!!!!!!!!!!!!!!!
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: moveto not working with variables

Postby Bee-Ant » Sat Feb 09, 2008 5:14 am

==Kalladdolf== wrote:confusing, I know :roll:

:roll:
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron