I appreciate that you tried to help though. If we have a special Hitbox sprite that changes costumes, why is that not done in the Collision block? In addition, the Collision block seems to check two colors, but my game uses only one color (my game is called Monochrome), so I can't make the doors or the player be a different color. I don't understand how the Movement and Movement2 blocks work, and I don't understand the Collision custom block. If you could, it would be great if you could create separate sprites that have all the code that they are supposed to have. ![]() Load the example image, and have a click around. I would prefer it if I didn't need a separate hitbox sprite (my player is already a square), and I don't fully understand how your code works or how to integrate it. Sprite Cow helps you get the background-position, width and height of sprites within a spritesheet as a nice bit of copyable css. Yellow = RightCollide Blue = Left Red = Top And Finally Green = Down Collision. Pranav_reii wrote:This Might Help, Add This Code To The Previous Scripts! Check Here, On Your Previous Id But Script Section 4 But Before That, You Need A Hitbox Colored, And The Door Always Has 0 (Closed) 1 (Opened), So If The Door Touches Player Then It Broadcasts A Message, The Player Detects Which Side It Hits Using A Colored Hitbox Like. for this example I will have a zombie and a human when I start as a clone if then zombie.get_id set to (100) // this is an example personal variable repeat until zombie-like scripting stuff replace item (clone_id) of with (x position) replace item (clone_id) of with (y position) replace item (clone_id) of with (costume name :: looks) end lete end if then repeat until human-like script if then human.find_closest_zombie_id // make sure you check the "Run without screen refresh" box if then do something end end end delete this clone end define zombie.get_id if then add (x position) to add (y position) to add (costume name :: looks) to set to (length of :: list) // clone_id is a personal variable else set to (item # of in :: list) replace item (clone_id) of with (x position) replace item (clone_id) of with (y position) replace item (clone_id) of with (costume name :: looks) end define lete replace item (clone_id) of with () replace item (clone_id) of with () replace item (clone_id) of with () delete this clone define human.find_closest_zombie_id set to (1) // this must be a personal variable set to // this must be a personal variable set to // this must be a personal variable repeat until (length of :: list)> if then set (closest_zombie_distance) to ( of ((((item (i) of :: list) - (x position)) * ((item (i) of :: list) - (x position))) + (((item (i) of :: list) - (y position)) * ((item (i) of :: list) - (y position)))) set to (i) end change by (1) end The ones where the code off goes offscreen looks like this if then set (closest_zombie_distance) to ( :: list) - (y position)))) Learning how the “human.find_closest_zombie_id” function works will fix all of your worldly problems I am human, I make mistakes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |