Game Development Reference
In-Depth Information
void
GameApplication::OnPointerPressed(CoreWindow^
sender, PointerEventArgs^ args)
{
auto pt = args->CurrentPoint->Position;
m_renderer->PointerPressed(pt.X, pt.Y);
}
In the given code we simply extract the Position property from the current point
provided in the arguments, and pass it directly to the respective function inside the
Game class, which we just implemented. Now you should be able to run the game
and click on (or touch) the top and bottom of the screen, and see the player sprite
move towards that side. You might also want to clean up some of the content from
the previous chapter if you have been following along, as we won't need the enemy
sprite or text for this chapter, but leave them loading; we'll return and use those in a
later chapter.
Search WWH ::




Custom Search