I am creating a simple space shooter game to practice OF. I want to create a background that moves so it looks like the spaceship is moving through the star.jpeg I loaded. Anyone have any suggestions. As of now my image is just static and I am using
I haven’t tested the code, but the idea is to have two images that scroll together, so when one goes out the left side of the screen, it gets drawn on the right side again. The images should be continuous (no visible margin when put side to side)
Sorry, bgPos is a glm::vec2, so you should use bgPos = glm::vec2(0,0);
glm library is already included in OF latest version, no need to add it manually. Use ofVec2f instead of glm::vec2 if you are not using latest OF version
pd. use bgPos.x -= 2 * ofGetLastFrame() // 2 pixels per second… note the bgPos.x