I use void instead of function, well cause Monkey uses that and he's cool.
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 Menu
function room_RepExec()
{
if (bMoving) player.GetZones();
cShadow.Loop = player.Loop;
if (bShadowInitialize && !(player.Moving))
{
//in the game settings you can turn shadows on/off, when set to on, query the zone the player is over
if (bActivate_ZoneA) cShadow.ShadowInitialize(oLongGrass_A, 1);
if (bActivate_ZoneB) cShadow.ShadowInitialize(oLongGrass_B, 2);
if (bActivate_ZoneC) cShadow.ShadowInitialize(oLongGrass_C, 3);
if (bActivate_ZoneD) cShadow.ShadowInitialize(oLongGrass_D, 4);
if (bActivate_ZoneE) cShadow.ShadowInitialize(oLongGrass_E, 5);
if (bActivate_ZoneF) cShadow.ShadowInitialize(oLongGrass_F, 6);
}
if (player == cTractor && player.Moving)
{
if (!bMoving) bMoving = true;
iLoop = player.GetCharacterDirection(); //get the direction so we can adjust the mower's cutting width
if (bShowShadow && !bShadowOff)
{
if (bActivate_ZoneA) oLongGrass_A.DrawOnShadowReceiver(4769, 1);
if (bActivate_ZoneB) oLongGrass_B.DrawOnShadowReceiver(4779, 2);
if (bActivate_ZoneC) oLongGrass_C.DrawOnShadowReceiver(4780, 3);
if (bActivate_ZoneD) oLongGrass_D.DrawOnShadowReceiver(4781, 4);
if (bActivate_ZoneE) oLongGrass_E.DrawOnShadowReceiver(4782, 5);
if (bActivate_ZoneF) oLongGrass_F.DrawOnShadowReceiver(4783, 6);
}
}
if (!bShowShadow)
{
if (bShadowOff && player.Moving)
{
if (bActivate_ZoneA) oLongGrass_A.ClearShadowReceiver(4769);
if (bActivate_ZoneB) oLongGrass_B.ClearShadowReceiver(4779);
if (bActivate_ZoneC) oLongGrass_C.ClearShadowReceiver(4780);
if (bActivate_ZoneD) oLongGrass_D.ClearShadowReceiver(4781);
if (bActivate_ZoneE) oLongGrass_E.ClearShadowReceiver(4782);
if (bActivate_ZoneF) oLongGrass_F.ClearShadowReceiver(4783);
}
}
void ShowShadow(this Character*, Object* onWhat, int iZone)
{
if (bShowShadow == true)
{
cShadow.Loop = player.Loop;
//first clear any shadows on surface by reverting back to original object surface's sprite...in room script
dsSource = DynamicSprite.CreateFromExistingSprite(onWhat.Graphic, true);
if (iZone == 1) dsApplyShadow_A = DynamicSprite.CreateFromExistingSprite(onWhat.Graphic, true);
else if (iZone == 2) dsApplyShadow_B = DynamicSprite.CreateFromExistingSprite(onWhat.Graphic, true);
else if (iZone == 3) dsApplyShadow_C = DynamicSprite.CreateFromExistingSprite(onWhat.Graphic, true);
else if (iZone == 4) dsApplyShadow_D = DynamicSprite.CreateFromExistingSprite(onWhat.Graphic, true);
else if (iZone == 5) dsApplyShadow_E = DynamicSprite.CreateFromExistingSprite(onWhat.Graphic, true);
else if (iZone == 6) dsApplyShadow_F = DynamicSprite.CreateFromExistingSprite(onWhat.Graphic, true);
player.GetShadowSprite();
iShadowSpriteBkp = iShadowSprite;
iShadowAreaW = Game.SpriteWidth[iShadowSprite];
iShadowAreaH = Game.SpriteHeight[iShadowSprite];
getZoneAdjustment(iZone);
int iX = this.x - (iShadowAreaW/2) + iXzoneAdjust; //substract the length of the sprite + ifactor
int iY = this.y - (iShadowAreaH/2) + iYzoneAdjust + iYadjust;
if (iZone == 1) DrawSprite(dsApplyShadow_A.Graphic, iShadowSprite, iX, iY, eBlendMultiply, 0); //draw shadow on top
else if (iZone == 2) DrawSprite(dsApplyShadow_B.Graphic, iShadowSprite, iX, iY, eBlendMultiply, 0); //draw shadow on top
else if (iZone == 3) DrawSprite(dsApplyShadow_C.Graphic, iShadowSprite, iX, iY, eBlendMultiply, 0); //draw shadow on top
else if (iZone == 4) DrawSprite(dsApplyShadow_D.Graphic, iShadowSprite, iX, iY, eBlendMultiply, 0); //draw shadow on top
else if (iZone == 5) DrawSprite(dsApplyShadow_E.Graphic, iShadowSprite, iX, iY, eBlendMultiply, 0); //draw shadow on top
else if (iZone == 6) DrawSprite(dsApplyShadow_F.Graphic, iShadowSprite, iX, iY, eBlendMultiply, 0); //draw shadow on top
if (iZone == 1) onWhat.Graphic = dsApplyShadow_A.Graphic;
else if (iZone == 2) onWhat.Graphic = dsApplyShadow_B.Graphic;
else if (iZone == 3) onWhat.Graphic = dsApplyShadow_C.Graphic;
else if (iZone == 4) onWhat.Graphic = dsApplyShadow_D.Graphic;
else if (iZone == 5) onWhat.Graphic = dsApplyShadow_E.Graphic;
else if (iZone == 6) onWhat.Graphic = dsApplyShadow_F.Graphic;
iShadowSprite = iShadowSpriteBkp;
}
}
while (iY1 < dsSourceGraphic.Height) //768
{
while (iX1 < sSourceGraphic.Width) //1024
{
//iAlpha = GetAlpha(dsLongGrass.Graphic, iY1, iX1);
//ds.DrawingColor = Game.GetColorFromRGB(iAlpha,iAlpha,iAlpha); //this is a grey color representing the alpha.
//ds.DrawPixel(iX1,iY1); // draw the alpha to the copy.
iX1++;
}
iY1++;
iX1 = 0;
}
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.067 seconds with 14 queries.