? Need help with collisions with spawn objects SB 3ds (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
What's going on?? See: Site Update March 2022

Need help with collisions with spawn objects SB 3ds

  • #1 ✎ 11 ninja12 Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies Video Games I like to play video games! Hobbies Hello Im trying to get a working combat system going. I was able to have my player hit an enemy with an hp spvar with a spawned hit box sprite, after 4 hits he's defeated but I since changed the code to spawn an enemy at startup using Def. and the spawned hit box is also added using a Def. but now the enemy is not sensing the collision from the hit box. Any help would be appreciated thanks Posted
  • #2 ✎ 412 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Third Year My account is over 3 years old Website Reading I like to read books! Hobbies Can you post a key to the program? Posted
  • #3 ✎ 11 ninja12 Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies Video Games I like to play video games! Hobbies Thanks for the reply, but I figured it out. I had to rewrite the code and work on the collision. A question though. I have a Def that handles the hit damage now when the hp reaches 0 and the enemy needs to be cleared after few seconds. Should I have a separate def function, to handle that? Thanks Posted Edited by ninja12
  • #4 ✎ 412 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Third Year My account is over 3 years old Website Reading I like to read books! Hobbies Well, personally, I like to create functions that serve unique objectives. Like, one function for spawning enemies, one function for handling damage dealt against enemies, one function for killing/despawning enemies, and so on. I wouldn't say there's a rule of thumb on the matter, just use whatever layout works for you. Posted
  • #5 ✎ 11 ninja12 Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies Video Games I like to play video games! Hobbies I think I like that approach thanks. Posted