Aha, gotcha. Thank you!
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 Menufunction repeatedly_execute_always()
{
int ran=Random(1);
int ran2=Random(3);
if (cPlayer.View==2) //This is the 'aiming' view that enables when the player selects the gun from their inventory.
{
if (ran2==0)
{
mouse.Update();
mouse.SetPosition(mouse.x + ran, mouse.y + ran);
}
else if (ran2==1)
{
mouse.Update();
mouse.SetPosition(mouse.x - ran, mouse.y - ran);
}
else if (ran2==2)
{
mouse.Update();
mouse.SetPosition(mouse.x + ran, mouse.y - ran);
}
else
{
mouse.Update();
mouse.SetPosition(mouse.x - ran, mouse.y + ran);
}
}
}
mouse.SetPosition(mouse.x, mouse.y-40);
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawImage(cZombie.x-16, cZombie.y-48, 105); //weird quirk in AGS offsets the sprite coordinates from the character coordinates. No idea why, but offsetting the coordinates like this works.
surface.Release();
Character: &1 This is a line of dialog.
hotspot1_interact()
{
if (axe == 0)
{
player.ChangeRoom(2)
}
}
function repeatedly_execute()
{
if (axe == 0)
{
player.ChangeRoom(2);
}
}
function repeatedly_execute()
{
if ((player.Room != 2) && (axe == 0)) //checks player isn't already in room 2 and that axe==0
{
player.ChangeRoom(2);
}
}
Quote from: Cassiebsg on Mon 04/05/2020 16:02:22
Fedx, just place your sky object in a sky GUI instead, then make sure the z order is in front of the flashlight.
if (zombie_state==1)
{
cZombie.StopMoving();
cZombie.FollowCharacter(cPlayer, 1, 1);
zombie_state=2;
}
//Check distance from player for attacks
if (cPlayer.Room == cZombie.Room)
{
check_zombie_distance();
}
//Zombie patrolling the area
if (zombie_state==0)
{
if (cZombie.Moving==false)
{
cZombie.Walk(Random(1280), Random(720), eNoBlock, eWalkableAreas);
}
}
//Zombie chasing player
else if (zombie_state==1)
{
cZombie.FollowCharacter(cPlayer);
}
function check_zombie_distance()
{
//Check if a zombie is nearby and should therefore change to state 1
if ((cZombie.x - cPlayer.x < 400) && (cZombie.x - cPlayer.x > -400) && (cZombie.y - cPlayer.y < 300) && (cZombie.y - cPlayer.y > -300))
{
zombie_state=1;
}
//Check if a zombie is close and should therefore attack
if ((cZombie.x - cPlayer.x < 30) && (cZombie.x - cPlayer.x > -30) && (cZombie.y - cPlayer.y < 30) && (cZombie.y - cPlayer.y > -30))
{
zombie_attack();
}
}
import function zombie_die;
import function shoot;
function zombie_die()
{
if (cZombie.FaceDirection==eDirectionDown)
{
cZombie.ChangeView(12);
cZombie.Animate(0, 5, eOnce, eBlock, eForwards);
cZombie.FollowCharacter(null);
zombie_dead=true;
}
else if (cZombie.FaceDirection==eDirectionLeft)
{
cZombie.ChangeView(12);
cZombie.Animate(1, 5, eOnce, eBlock, eForwards);
cZombie.FollowCharacter(null);
zombie_dead=true;
}
else if (cZombie.FaceDirection==eDirectionRight)
{
cZombie.ChangeView(12);
cZombie.Animate(2, 5, eOnce, eBlock, eForwards);
cZombie.FollowCharacter(null);
zombie_dead=true;
}
else
{
cZombie.ChangeView(12);
cZombie.Animate(3, 5, eOnce, eBlock, eForwards);
cZombie.FollowCharacter(null);
zombie_dead=true;
}
function shoot()
{
if (ammo<1)
{
SetSpeechStyle(eSpeechLucasarts);
cPlayer.Say("I'm out of ammo!");
SetSpeechStyle(eSpeechSierra);
}
else
{
cPlayer.FaceCharacter(cZombie);
if (player.FaceDirection==eDirectionDown)
{
cPlayer.ChangeView(13);
cPlayer.Animate(0, 3, eOnce, eBlock, eForwards);
ammo=ammo-1;
cPlayer.ChangeView(4);
zombie_die();
cZombie.FollowCharacter(null);
}
else if (player.FaceDirection==eDirectionLeft)
{
cPlayer.ChangeView(13);
cPlayer.Animate(1, 3, eOnce, eBlock, eForwards);
ammo=ammo-1;
cPlayer.ChangeView(4);
zombie_die();
cZombie.FollowCharacter(null);
}
else if (player.FaceDirection==eDirectionRight)
{
cPlayer.ChangeView(13);
cPlayer.Animate(2, 3, eOnce, eBlock, eForwards);
ammo=ammo-1;
cPlayer.ChangeView(4);
zombie_die();
cZombie.FollowCharacter(null);
}
else
{
cPlayer.ChangeView(13);
cPlayer.Animate(3, 3, eOnce, eBlock, eForwards);
ammo=ammo-1;
cPlayer.ChangeView(4);
zombie_die();
cZombie.FollowCharacter(null);
}
}
}
SetViewport(cBuggy.x, cBuggy.y-400);
Quote from: ManicMatt on Fri 16/11/2018 21:39:11
wow you have voice acting already?! That's the last thing on my list! Sounds good though.
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.086 seconds with 13 queries.