ggn Posted January 8, 2018 Share Posted January 8, 2018 thanks for the help ! now the code is like the original example but the color of lines dont swap...its strange ? Well, in your modified code: IF A > RoadStripe1 THEN rsetobj(A,R_sprite_CLUT, 2 ) END IF IF A <= RoadStripe1 THEN rsetobj(A,R_sprite_CLUT, 1 ) END IF RoadStripe is always 66 so the if will always be false. Just for fun I modified your code to IF ((A+counter) band 15) > 7 THEN rsetobj(A,R_sprite_CLUT, 2 ) else rsetobj(A,R_sprite_CLUT, 1 ) END IF and added a variable counter which is increased per VBL. Yay, fake movement and IF mod ( ZMap[A] + TexOffset , 100 ) > 50 THEN make the loop slow... Yes it should. This makes the cpu perform floating point divisions and return the modulo. Division is very expensive on its own but then rb+ also has to call an external library to do this which is even slower. Do that 66 times per frame and you end up with very slow code! Like I said in a previous post, you need to convert all this from floating point to fixed point to make it fast enough. 5 Quote Link to comment Share on other sites More sharing options...
F.L Posted January 8, 2018 Share Posted January 8, 2018 " RoadStripe is always 66 so the if will always be false" oups ! its normal i forget to remove the comment before this do RoadStripe1 = RoadStripe1 - SpeedScroll with your modify, it gives a nice stripe effect ! now all this is waiting to move this example in basic of lou gorenfeld is very pleasant to modify and to play with it. he gave it many years ago on his website but now he has removed it. why ? maybe because it was just a quickly example to show the roadstripes with qb45 but i have keep it with qb64 and what i done with this remake of outrun is a little weird but it's more simple for me if someone follow all the explanations of his very insteresting website, he can to a better things ! 4 Quote Link to comment Share on other sites More sharing options...
Sporadic Posted January 8, 2018 Author Share Posted January 8, 2018 Making great progress I've not had chance to look at your code/ROM but it sounds like you're doing well. 1 Quote Link to comment Share on other sites More sharing options...
F.L Posted January 11, 2018 Share Posted January 11, 2018 try this for a better line effect LineCounter = LineCounter + 1 if LineCounter >= (HalfWidth/12) and RoadColor = 1 then RoadColor = 2 : LineCounter = 0 if LineCounter >= (HalfWidth/12) and RoadColor = 2 then RoadColor = 1 : LineCounter = 0 with this, the far lines are smaller than the closest lines i have done a try to move those lines but its not perfect yet. (in attached file) somebody want to try ? i think i will port with rb+ this little 80's road game that i have made on sega genesis with basiegaxoez a few years ago : https://www.youtube.com/watch?v=Fbky1d0kUXE i think with rb+, i will have smoother curves and a better sound engine 2Droad.zip 4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.