Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Пятна?ки  (Read 2000 times)

0 Members and 1 Guest are viewing this topic.

Dionysius

  • Moderator
  • Frequent poster
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 361
    • View Profile
    • On the Tracks of Dinosaurs
Пятна?ки
« on: March 11, 2009, 06:12:46 AM »

Скрипт игры 15 от анонимного пользователя:
Quote
scene_init.script

#include "scripts\base.inc"

actor.SkipTo(685, 220);

actor.Active = false;


// here comes the stuff which initializes the scene
global aa = Scene.LoadEntity("entities\aa.entity");
aa.dest_stat=1;
aa.dest_win=13;
aa.SkipTo(505, 130);

global ab = Scene.LoadEntity("entities\ab.entity");
ab.dest_stat=2;
ab.dest_win=3;
ab.SkipTo(595, 130);

global ac = Scene.LoadEntity("entities\ac.entity");
ac.dest_stat=3;
ac.dest_win=15;
ac.SkipTo(685, 130);

global ad = Scene.LoadEntity("entities\ad.entity");
ad.dest_stat=4;
ad.dest_win=7;
ad.SkipTo(775, 130);

global ba = Scene.LoadEntity("entities\ba.entity");
ba.dest_stat=5;
ba.dest_win=11;
ba.SkipTo(505, 220);

global bb = Scene.LoadEntity("entities\bb.entity");
bb.dest_stat=6;
bb.dest_win=12;
bb.SkipTo(595, 220);

global bc = Scene.LoadEntity("entities\bc.entity");
bc.dest_stat=7;
bc.dest_win=14;
bc.SkipTo(685, 220);

global bd = Scene.LoadEntity("entities\bd.entity");
bd.dest_stat=8;
bd.dest_win=4;
bd.SkipTo(775, 220);

global ca = Scene.LoadEntity("entities\ca.entity");
ca.dest_stat=9;
ca.dest_win=1;
ca.SkipTo(505, 310);

global cb = Scene.LoadEntity("entities\cb.entity");
cb.dest_stat=10;
cb.dest_win=10;
cb.SkipTo(595, 310);

global cc = Scene.LoadEntity("entities\cc.entity");
cc.dest_stat=11;
cc.dest_win=9;
cc.SkipTo(685, 310);

global cd = Scene.LoadEntity("entities\cd.entity");
cd.dest_stat=12;
cd.dest_win=8;
cd.SkipTo(775, 310);

global da = Scene.LoadEntity("entities\da.entity");
da.dest_stat=13;
da.dest_win=5;
da.SkipTo(505, 400);

global db = Scene.LoadEntity("entities\db.entity");
db.dest_stat=14;
db.dest_win=2;
db.SkipTo(595, 400);

global dc = Scene.LoadEntity("entities\dc.entity");
dc.dest_stat=15;
dc.dest_win=6;
dc.SkipTo(685, 400);

global dd = Scene.LoadEntity("entities\dd.entity");
dd.dest_stat=16;
dd.dest_win=16;
dd.SkipTo(775, 400);

global taken;
taken[0]=aa;
taken[1]=ab;
taken[2]=ac;
taken[3]=ad;
taken[4]=ba;
taken[5]=bb;
taken[6]=bc;
taken[7]=bd;
taken[8]=ca;
taken[9]=cb;
taken[10]=cc;
taken[11]=cd;
taken[12]=da;
taken[13]=db;
taken[14]=dc;
taken[15]=dd;
////////////////////////////////////////////////////////////////////////////////
// scene state
global StateRoom;


// default values
if(StateRoom==null)
{
StateRoom.Visited = false;
// add scene states here
}


taken.script

#include "scripts\base.inc"


////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
global dd;

if (dd.X == this.X)
{
switch (dd.Y - this.Y)
{
case 90:
this.SkipTo(this.X, this.Y+90);
Game.Msg(this.dest_stat);
this.dest_stat = this.dest_stat + 4;
Game.Msg(this.dest_stat);
dd.SkipTo(dd.X, dd.Y-90);
dd.dest_stat = dd.dest_stat - 4;
this.PlaySound("sounds\click.ogg");
break;

case (-90):
this.SkipTo(this.X, this.Y-90);
this.dest_stat = this.dest_stat - 4;
dd.SkipTo(dd.X, dd.Y+90);
dd.dest_stat = dd.dest_stat + 4;
this.PlaySound("sounds\click.ogg");
break;
};
};

if (dd.Y == this.Y)
{
switch (dd.X - this.X)
{
case 90:
this.SkipTo(this.X+90, this.Y);
this.dest_stat = this.dest_stat + 1;
dd.SkipTo(dd.X-90, dd.Y);
dd.dest_stat = dd.dest_stat - 1;
this.PlaySound("sounds\click.ogg");
break;

case (-90):
this.SkipTo(this.X-90, this.Y);
this.dest_stat = this.dest_stat -1;
dd.SkipTo(dd.X+90, dd.Y);
dd.dest_stat = dd.dest_stat + 1;
this.PlaySound("sounds\click.ogg");
break;
};
};
Game.Msg(this.rotate);
//check win;

global taken;
var cost = 0;
for(var i=0; i<16; i=i+1)
{
var tmp = taken;
if (tmp.dest_stat == tmp.dest_win)
{
cost=cost+1;
};
};
if (cost == 16)
{
Game.Msg("wine" + cost);
}
else
{
Game.Msg(cost);
};
};



aa.entity

ENTITY
{
NAME="aa"
CAPTION="taken_aa"
X=80
Y=80
SCALABLE=TRUE
INTERACTIVE=TRUE
COLORABLE=TRUE
SOUND_PANNING=TRUE
SPRITE="entities\aa.sprite"
TALK="entities\aa.sprite"
SCRIPT="entities\taken.script"
FONT = "fonts\outline_white.font"
}


aa.sprite

; generated by SpriteEdit

; $EDITOR_PROJECT_ROOT_DIR$ ..\..\

SPRITE {
NAME="aa"
LOOPING=TRUE
CONTINUOUS=FALSE
PRECISE=TRUE
FRAME {
DELAY = 0
KEYFRAME=FALSE
IMAGE = "scenes\Room\taken\aa.png"
EDITOR_SELECTED=TRUE
}

}
Коррективы от пользователя gambit:http://ifolder.ru/9648056
Logged
 

Page created in 0.141 seconds with 23 queries.