Ok, I found the answer.
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 iMyItem_Interact()
{
// do something;
}
// called when a key is pressed
function on_key_press(eKeyCode keycode)
{
if (keycode == eKeyReturn)
{
// Text box input accept:
if (gGuiText.Visible == true)
{
// Hide GUI
gGuiText.Visible = false;
//..........DoSomethingElse();
}
}
}
Quote from: Darth Mandarb on Sat 05/12/2020 16:46:40
Is this being made with AGS?
Also; please review the forum rules and update your post accordingly (two in game screenshots and some details about the game).
Good luck with the production!
Quote from: eri0o on Sat 28/11/2020 13:18:22
If you do need to instantiate something, you can have a bunch of pre-created dummy characters that you pickup from a room that's not part of your game, moved from there to the current room, do what you must, and put them back in that room once business are taken care. In this way you are not creating them dynamically but you still get to do similar things.
function ShowExplosion(int x, int y)
{
Object* objExplosion;
objExplosion = new Object;
objExplosion.X = x;
objExplosion.Y = y;
objExplosion.SetView(......proper view...);
objExplosion.Animate(...proper animation....);
}
Object objExplosion = new Object();
Quote from: eri0o on Wed 25/11/2020 11:25:59
You can also convert the coordinates (if you are using the newest versions of AGS) usingCode: ags Point* room_point = Screen.ScreenToRoomPoint(mouse.x, mouse.y); player.FaceLocation(room_point.x, room_point.y);
I actually haven't understood quite yet what's going on but other idea I would have is adding some offset in the y position to see if this fix FaceLocation. You can also write your own logic using FaceDirection. But I have trouble understanding text descriptions because I am a more visual person.
Quote from: Crimson Wizard on Tue 24/11/2020 23:49:47
Regarding why it may face wrong direction, for instance FaceLocation requires room coordinates, so proper use would be:Code: ags player.FaceLocation(mouse.x + Game.Camera.X, mouse.y + Game.Camera.Y, eBlock);
Quote from: eri0o on Tue 24/11/2020 23:47:17
Does this room scrolls? (Is it bigger than the game screen?) I ask because FaceLocation uses Room coordinates and not screen coordinates.
player.LockView(10);
player.FaceLocation(mouse.x, mouse.y, eBlock);
player.Animate(player.Loop, 1, eOnce);
player.UnlockView();
function on_mouse_click(MouseButton button)
{
if (IsGamePaused())
{
return;
}
if (button == eMouseLeft)
{
// if in fight mode, left click just has to move player:
if (mouse.Mode == eModeUseWeapon)
{
Room.ProcessClick(mouse.x, mouse.y, eModeWalkto);
}
else
{
Room.ProcessClick(mouse.x, mouse.y, mouse.Mode);
}
}
else if (button == eMouseRight)
{
if (mouse.Mode != eModeUseWeapon)
{
SetWalkToMode(); // a custom function which sets walk-to mode
}
else
// In weapon-on mode, right-click = attack
{
MyPlayer.LockView(10, eStopMoving);
MyPlayer.FaceLocation(mouse.x, mouse.y, eNoBlock);
int currentDirection = MyPlayer.Loop;
MyPlayer.Animate(currentDirection, 1, eOnce, eBlock, eForwards);
MyPlayer.UnlockView(eStopMoving);
}
}
}
Quote from: eri0o on Wed 18/11/2020 09:40:47
If you are going this route, on the indexed palette, the FIRST color will be the 0 (ERASER) in walkable area, the second color in the indexed palette will be the 1 (Walkable 1, the blue one), the third will be the 2 (Walkable area 2, the green one), and so on.
If you can, use Aseprite since it's easier to deal with pallettes in it. People also say good things of Graphics Gale.
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.038 seconds with 14 queries.