int DC_UP[33];
int DC_DOWN[33];
int DC_LEFT[33];
int DC_RIGHT[33];
DC_UP[0]=0; <---ERROR
DC_DOWN[0]=1;
error: room41.asc(6): Error (line 6): Parse error: unexpected 'DC_UP'
:/
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menuint DC_UP[33];
int DC_DOWN[33];
int DC_LEFT[33];
int DC_RIGHT[33];
DC_UP[0]=0; <---ERROR
DC_DOWN[0]=1;
function IsOverlappingCO(Character *ch, Object *ob)
{
int v = ch.View;
ViewFrame* frame = Game.GetViewFrame(v, 0, 0);
int wC = Game.SpriteWidth[frame.Graphic];
int hC = Game.SpriteHeight[frame.Graphic];
// +---^---+
// | | |
// | | |
// <---X--->
//character measures from bottom-centre corner up
//actual coords +/- dimensions
int TLCharX = (ch.x - (wC/2));
int TLCharY = (ch.y - (hC));
int BRCharX = TLCharX + wC;
int BRCharY = TLCharY + hC;
//==
int wO = Game.SpriteWidth[ob.Graphic];
int hO = Game.SpriteHeight[ob.Graphic];
// ^-------+
// | |
// | |
// X------->
//object measures from bottom-left corner up
//actual coords +/- dimensions
int TLObjX = ob.X;
int TLObjY = ob.Y - hO;
int BRObjX = ob.X + wO;
int BRObjY = ob.Y;
// l2
// tlobj
// +---------+
// | obj |
// l1 | |
// tlchar | |
// +-----------+ |
// | char | | |
// | | | |
// | +----|----+r2
// | | brobj
// +-----------+r1
// brchar
//
// the line cannot have positive overlap
if (TLCharX == BRCharX || TLCharY == BRCharY || TLObjX == BRObjX || TLObjY == BRObjY) return false;
// If one rectangle is on left side of other
if (TLCharX >= BRObjX || TLObjX >= BRCharX) return false;
// If one rectangle is above other
if (TLCharY >= BRObjY || TLObjY >= BRCharY) return false;
return true;
}
//arguments: takes the character walking over a hotspot 'ch', the hotspot itself 'hs', x/y coords (ie. of tank)
//result: decides which new direction is the shortest line between the ch.x,y and tank x,y, chooses this as new direction
function ChooseDirectionBasedOnDisanceToTank(character ch, hotspot hs, int x, int y)
{
//down:
if (hs.ID==3 || hs.ID == 6 hs.ID==7 || hs.ID==11 || hs.ID==14 || hs.ID==15) { //hotspots that contain down as direction
//todo: write (ch.x, ch.y+10) coords into decision
}
//up
if (hs.ID==9 || ....
//todo: write (ch.x, ch.y-10) coords
}
//todo: review array, find smallest dx,dy line joining x,y and ch.xy, choose direction
}
//hotspot functions
function hDownLeft_WalkOn()
{
if (character.ID>=59 && character.ID<=63) { //one of the 5 'crowds'
if (hotspot.ID!=character.GetProperty("AG_current_hotspot") && hotspot.ID>0) {
ChooseDirectionBasedOnDisanceToTank(character.ID, hotspot.ID, x, y);
}
}
}
cMainframe.SayAtBubble(mainframe_talk_x,mainframe_talk_y,"&36 Hahahahahahahaha! Oh yes -- *"Doctor"* Braun. What was it he was a doctor of? Dog-ology or something?");
cMainframe.SayAtBubble(mainframe_talk_x,mainframe_talk_y,"&36 Hahahahahahahaha! Oh yes -- *''Doctor''* Braun. What was it he was a doctor of? Dog-ology or something?");
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.035 seconds with 14 queries.