? bg collision (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

bg collision

  • #1 ✎ 149 Komodo Pokemon Is Awesome! I love Pokemon! Express Yourself Drawing I like to draw! Hobbies Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength ok so i figured out how sprite collision works ,but how do you do it with bg tiles instead of sprites for things like opening a chest or walking through a door. Posted
  • #2 ✎ 248 UltraPhoenix4 First Year My account is over 1 year old Website Bees Hidden Easter Eggs Avatar Taboo I didn't change my avatar for 180 days Website I don't know this either but it would be very helpful to know. I know an easy way out of this though. Make sprites of the thing then just do what you were going to do with the background with the sprites! Posted
  • #3 ✎ 302 Minxrod Summer 2016 Contest Participant I participated in the SmileBASIC Source Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Pokemon Is Awesome! I love Pokemon! Express Yourself You can use something called SPECIAL_MAP[bg_size_x,bg_size_y], and when you press A check for certain values, when you move check certain values, etc. Basically an array holding all 'special' interactions data. Posted Edited by Minxrod
  • #4 ✎ 149 Komodo Pokemon Is Awesome! I love Pokemon! Express Yourself Drawing I like to draw! Hobbies Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength
    I don't know this either but it would be very helpful to know. I know an easy way out of this though. Make sprites of the thing then just do what you were going to do with the background with the sprites!
    will that actually work because i was thinking about doing that?
    Posted Edited by Komodo
  • #5 ✎ 270 NeatNit First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself A function that should help is SPHITRC, which checks for a collision between a sprite and a rectangle. http://smilebasic.com/en/reference/#sprite (you should ctrl+f it) Posted
  • #6 ✎ 262 Super_Defaultio Video Games I like to play video games! Hobbies Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself SPHITRC is only sationary, not dynamic. If you want to check in certain directions of the sprite, use a Sprite Display Coordinate to Background Coordinate conversion sequence. SPOFS Management Number of Sprite OUT Variable X, Variable Y 'BGCOORD Converts display coordinates to BG screen coordinates, or vice versa 'Format BGCOORD Layer,Source X-coordinate,Source Y-coordinate[,Mode]OUT DX,DY 'Arguments Layer Layer number: 0-3 'Source X-, Y-coordinates Coordinates to convert (BG character coordinates or display coordinates) 'Mode Conversion mode: 0-2 '0: Converts BG screen coordinates to display coordinates '1: Converts display coordinates to BG screen coordinates (in character units) '2: Converts display coordinates to BG screen coordinates (in pixel units) 'DX,DY Variable to store the converted coordinates (BG character coordinates or display coordinates) 'Then use BGGET in the area where the BGCOLISSION will occur... its actually sorta complex to explain this one, so use the pop up help for the arguments. BGGET "code" Posted
  • #7 ✎ 270 NeatNit First Week Joined in the very first week of SmileBASIC Source Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself
    SPHITRC is only sationary, not dynamic.
    What do you mean? You can specify the direction of movement for the rectangle, if you wish to do that.
    Posted
  • #8 ✎ 262 Super_Defaultio Video Games I like to play video games! Hobbies Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself
    SPHITRC is only sationary, not dynamic.
    What do you mean? You can specify the direction of movement for the rectangle, if you wish to do that.
    So SPCOLVEC? I have no idea what it does, or how to use it.
    Posted