? BGOFS/BGHOME (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

BGOFS/BGHOME

  • #1 ✎ 1536 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website SPOFS: Units are always screen pixels Positive numbers move the object down/right SPHOME: Units depend on the object scale Positive numbers move the object up/left BGHOME: Units are always screen pixels Positive numbers move the object down/right BGOFS: Units depend on the object scale Positive numbers move the object up/left My theory is that BGHOME and BGOFS were switched by accident, and by the time anyone noticed, it was too late to fix without breaking every game that used BG. Posted
  • #2 ✎ 91 niconii Video Games I like to play video games! Hobbies Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Drawing I like to draw! Hobbies This seems plausible to me, and the detail about the units they use is strong evidence for your theory. If not for that, however, I don't think I'd be quite as convinced, because I think BGOFS using positive numbers for up/left might be more intuitive anyway. If you start a sprite at the top-left of the screen and increase SPOFS's coordinates, the result is that the sprite appears to move down and right. Similarly, if you place a stationary sprite in front of a background, and increase BGOFS's coordinates, the result is that the sprite appears to move down and right, in relation to the background. Even though it's actually the background that's moving up and left, people tend to interpret the background as a stationary thing that the camera is panning across. In other words, you could think of BGOFS's coordinates as being the coordinates of the camera rather than the background itself. Consider this as well: you're almost never in a situation where you want to move the camera outside the boundaries of the background. BGOFS using positive numbers for moving up/left is well-suited for this, as it means you'll be working exclusively with positive numbers. Conversely, BGOFS being down/right would mean exclusively using negative numbers. Posted Edited by niconii
  • #3 ✎ 892 snail_ Helper Received for being very helpful around SmileBASIC Source Achievements OSP Contest 2 Contest Participant I participated in the second SmileBASIC Source OSP Contest! Night Person I like the quiet night and sleep late. Express Yourself Quite honestly, the fact that the sprite and BG commands use the same naming convention but behave pretty differently (almost backwards) makes this more unintuitive than anything else. Posted