some questions

Game Editor comments and discussion.

some questions

Postby mellenor » Thu May 08, 2008 4:05 pm

Hi! I have a problem.
1.) I making the spalsh screen with different options he summons by "enter" i want to close him by "enter" too,
but when its on the same keys it dont works (i think works command destroy actor-- whp closes him - but it have not be so...
then actor creating by "enter" ----CreateActor("back2", "back2", "(none)", "(none)",480,0,false);
view.x+=100;------- he dosnt created yet to react on enter. But then destroy placed on different key it works
2.) in this script ----CreateActor("back2", "back2", "(none)", "(none)",480,0,false);
view.x+=100;------- view.x+=100 and its works but why i must wrtite 100 but not 480... By logic view must be moved there created actor ---CreateActor("back2", "back2", "(none)", "(none)",480,0,false);---
3) I have tried view.x=back2.x; but it not moves to same position as back2
Here is my simple demo
4) Ноw to make actor moving where mouse cliks (you clicks on terran and player goes there), i now it can be make it by "move to" on background, is exist more elegant way?
5) How to make changing animations (then actor moving by mouse clicks), different animation for diferent directions?
6) When actor moving by mouse clicks...he goes to the point by shortest by -- diagonally. Is it possible to make he part of the way to that point vertically, after that he moves gorisontally.
Attachments
game.rar
(11.74 KiB) Downloaded 89 times
mellenor
 
Posts: 10
Joined: Mon Apr 07, 2008 11:10 am
Score: 0 Give a positive score

Re: some questions

Postby DST » Thu May 08, 2008 7:51 pm

Ok, first use a variable to control enter.
Like this: variable (global, integer) name 'play'.

on key down (return)
Code: Select all
switch (play){
case 0:
Do this etc.
play +=1;
break;
case 1:
do this next thing;
play +=1;
break;
}


This will allow you to do different things with the return key.

Secondly, its not good to try to refer to actors who are not in your current activation region;
back2, for instance, should be created on startup; it won't exist until you move the view to intersect the activation region anyway.

And lastly, all region actors (canvas, view, activation region, wireframe, filled region) have their xy coordinates starting at the top left corner, while all other actors have their xy in the center;

So to make view follow your actor in a game that is 240 px wide, it would be
Code: Select all
view.x=actor.x-120;
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: some questions

Postby mellenor » Thu May 08, 2008 8:32 pm

Thank you very much.
Only one more question.
---back2, for instance, should be created on startup; it won't exist until you move the view to intersect the activation region anyway.--- You mean it loads in memory only then....view to intersect the activation region... ( i thinking on creating game for Pocket PC so i think its very impotnant question)
mellenor
 
Posts: 10
Joined: Mon Apr 07, 2008 11:10 am
Score: 0 Give a positive score

Re: some questions

Postby DST » Fri May 09, 2008 8:00 pm

It will only load when the view intersects its activation region.
At that moment, it's createactor script is executed.
If you have 'create on startup' set to 'no', then even when the view intersects it, its still not created.

The activation region works very well....nothing inside it exists unless the view is on it AND that actor is told to exist, whethery by CreateActor or "create on startup, yes'.

The reason i said you shouldn't refer to things in a nonactive region is that in Game Editor Mode, those things still exist; activation regions only work properly in EXE mode. This means that you may end up writing script that won't work the same in EXE mode as it did in GEmode.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron