Page 1 of 1

Code Issues

PostPosted: Sun Dec 02, 2012 1:42 am
by ESL
It is supposed to change the view to 640,480 when the letters are all destroyed but it doesn't. :( Also, the characters should separate into different paths.

The controls for the ship are mousepad and spacebar or left mouse click to shoot.

Also, when looking at others games in .ged, how to view the global code?

Thanks in advance.

Re: Code Issues

PostPosted: Sun Dec 02, 2012 2:21 am
by skydereign
You are using the moveto function. You want to use the MoveTo function. You can read about the differences here. http://game-editor.com/docs/script_reference.htm
Essentially moveto is a canvas function, MoveTo is for moving actors. Though, if you want to just jump the view to a new position, you should just change the xy variables.

ESL wrote:Also, when looking at others games in .ged, how to view the global code?

You can view global code by clicking the Script button at the top, and click global code. It is the same in all geds.

Re: Code Issues

PostPosted: Mon Dec 10, 2012 8:07 am
by ESL
Well, using MoveTo instead of moveto did the trick. Now, for some strange reason, when it goes to the next view, the players disappear.
Move the ship around with the mouse and use the spacebar to shoot.

Re: Code Issues

PostPosted: Mon Dec 10, 2012 7:31 pm
by skydereign
The reason they disappear is you have them constantly moving right at 5 pixels per frame. By the time you can move to the next screen, they will have moved beyond the second screen.

Re: Code Issues

PostPosted: Tue Dec 11, 2012 12:30 pm
by ESL
I am not sure how to change the pixels per frame rate.

Re: Code Issues

PostPosted: Tue Dec 11, 2012 7:57 pm
by skydereign
That rate isn't the problem. To change that you just change the xvelocity=5 to some other value, and change the x+=5 in player2's draw actor. The problem is you have that code in the first place. Why do you set them to move when the game starts? You don't seem to want them to move while you are shooting the letters.