• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Akari, Red, Kris, May - which Pokémon protagonist is your favorite? Let us know by voting in our semifinal favorite protagonist poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Frame rate problem -Sphere-

rm2kdude

Advanced Pixel-Artist
  • 358
    Posts
    20
    Years
    • Age 36
    • usa
    • Seen Oct 30, 2022
    Code:
    function game()
      {
      CreatePerson("person", "aegis.rss", false);
      SetPersonSpriteset("person", LoadSpriteset("Trunks.rss"));
    	AttachCamera("person");
    	SetRenderScript("Movement();");
    	AttachInput("person");//but we don't want the standard movement interfereing with the movement we'll be having so...
    BindKey(KEY_LEFT, "", "");
    BindKey(KEY_RIGHT, "", "");
    BindKey(KEY_UP, "", "");
    BindKey(KEY_DOWN, "", "");
    	MapEngine("Test.rmp", 60);
    }
    
    var facing, walker;
     
    function Movement()
    {
    	walker = GetInputPerson();
    	if (IsKeyPressed(KEY_UP))
    	if (IsKeyPressed(KEY_UP))
     
    	walker = GetInputPerson();
    	if (IsKeyPressed(KEY_UP))
    	{
    		if(!facing ||
    		    facing == "d" ||
    		   (!IsKeyPressed(KEY_LEFT) &&
    		    !IsKeyPressed(KEY_RIGHT)))
    		{
    			facing = "u";
    			QueuePersonCommand(walker, COMMAND_FACE_NORTH, true);
    		}
    		QueuePersonCommand(walker, COMMAND_MOVE_NORTH, true);
    	}
    	 
    	else if (IsKeyPressed(KEY_DOWN))
    	{
    		if(!facing ||
    		    facing == "u" ||
    		   (!IsKeyPressed(KEY_LEFT) &&
    		    !IsKeyPressed(KEY_RIGHT)))
    		{
    			facing = "d";
    			QueuePersonCommand(walker, COMMAND_FACE_SOUTH, true);
    		}
    		QueuePersonCommand(walker, COMMAND_MOVE_SOUTH, true);
    	}
    	
    	if (IsKeyPressed(KEY_LEFT))
    	{
    		if(!facing ||
    		    facing == "r" ||
    		   (!IsKeyPressed(KEY_UP) &&
    		    !IsKeyPressed(KEY_DOWN)))
    		{
    			facing = "l";
    			QueuePersonCommand(walker, COMMAND_FACE_WEST, true);
    		}
    		QueuePersonCommand(walker, COMMAND_MOVE_WEST, true);
    	}
    	else if (IsKeyPressed(KEY_RIGHT))
    	{
    		if(!facing ||
    		    facing == "l" ||
    		   (!IsKeyPressed(KEY_UP) &&
    		    !IsKeyPressed(KEY_DOWN)))
    		{
    			facing = "r";
    			QueuePersonCommand(walker, COMMAND_FACE_EAST, true);
    		}
    		QueuePersonCommand(walker, COMMAND_MOVE_EAST, true);
    	}
    }

    It takes like a second for the first frame to appear but also the frame 0 shouldn't be used when looking the animation..
     
    It's always in the movement, but I made 2 spritesets 1 for walking and another for standing. But to use both I'd need a variable so I'd name it hero_move. and if it =true I use trunks_walking.rss and if =false I use trunks.rss. Though since there is no IsNoKeyPressed it makes it impossible to figure out if I'm pressing a key.
     
    Back
    Top