Code Issues

Non-platform specific questions.

Code Issues

Postby ESL » Sun Dec 02, 2012 1:42 am

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.
Attachments
tryitagain.ged
(25.76 KiB) Downloaded 109 times
data.zip
(58.92 KiB) Downloaded 107 times
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: Code Issues

Postby skydereign » Sun Dec 02, 2012 2:21 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Code Issues

Postby ESL » Mon Dec 10, 2012 8:07 am

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.
Attachments
youdidit.ged
(27.96 KiB) Downloaded 110 times
data.zip
(69.64 KiB) Downloaded 104 times
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: Code Issues

Postby skydereign » Mon Dec 10, 2012 7:31 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Code Issues

Postby ESL » Tue Dec 11, 2012 12:30 pm

I am not sure how to change the pixels per frame rate.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: Code Issues

Postby skydereign » Tue Dec 11, 2012 7:57 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron