Referenced from lesson Player Animation
For each of the challenges below, see if you can come up with two EXAMPLEs of how it should work!
1) Warping - Program one key to "warp" the player to a set location, such as the center of the screen.
examples:
update-player( ) is
update-player( ) is
end
2) Boundaries - Change update-player
such that PLAYER
cannot move off the top or bottom of the screen.
examples:
update-player( ) is
update-player( ) is
end
3) Wrapping - Add code to update-player
such that when PLAYER
moves to the top of the screen, it reappears at the bottom, and vice versa.
examples:
update-player( ) is
update-player( ) is
end
4) Hiding - Add a key that will make PLAYER
seem to disappear, and reappear when the same key is pressed again.
examples:
update-player( ) is
update-player( ) is
end
These materials were developed partly through support of the National Science Foundation,
(awards 1042210, 1535276, 1648684, and 1738598).
Bootstrap:Algebra by Emmanuel Schanzer, Jen Poole, Ed Campos Jr, Flannery Denny, and Dorai Sitaram
is licensed under a
Creative Commons 4.0 Unported License.
Based on a work at www.BootstrapWorld.org.
Permissions beyond the scope of this license may be available by contacting
schanzer@BootstrapWorld.org.