![]() ![]() If done correctly, the player sprite should bounce off walls and stop when it jumps and hits a platform's bottom. This only works if the variables are global and can be accessed by any sprite. Program the following scripts on the player sprite:Īnother simple method without broadcasts would be to simply move the (up, down, left or right)ĭo this four times, once for each sensor. The parentheses() should be replaced with whichever direction it is detecting. The black should be the color of the wall, or whatever the player can not move through. The white should be the color of the sensor(left, right, top, or bottom). Program the following scripts on the wall sensor sprite:.The result should look like four colored lines. Draw four lines, each a different color, on each side (left, right, top, and bottom) of the costume. Erase all scripts and costumes (except the idle costume).It is vital that the player sprite uses velocity to enhance the realism of movement (including gravitational velocity) before making wall sensors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |