Jump to content


New Prototype - Driving thing

128 replies to this topic

#126 ggn OFFLINE  



  • 1,452 posts
  • Location:Athens, Greece

Posted Mon Jan 8, 2018 6:55 AM

thanks for the help !  :thumbsup:
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 )
		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 )
			rsetobj(A,R_sprite_CLUT, 1 )
		END IF		
and added a variable counter which is increased per VBL. Yay, fake movement ;)

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.

#127 F.L OFFLINE  


    Chopper Commander

  • 121 posts
  • Location:France

Posted Mon Jan 8, 2018 7:37 AM

" RoadStripe is always 66 so the if will always be false"


oups ! its normal :grin: i forget to remove the comment before this


RoadStripe1 = RoadStripe1 - SpeedScroll


with your modify, it gives a nice stripe effect ! now all this is waiting to move :D

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 :-D but it's more simple for me

if someone follow all the explanations of his very insteresting website, he can to a better things !

#128 Sporadic OFFLINE  



  • Topic Starter
  • 537 posts
  • Probably RB+ing
  • Location:UK

Posted Mon Jan 8, 2018 8:54 AM

Making great progress :)


I've not had chance to look at your code/ROM but it sounds like you're doing well.

  • ggn likes this

#129 F.L OFFLINE  


    Chopper Commander

  • 121 posts
  • Location:France

Posted Thu Jan 11, 2018 12:42 PM

try this for a better line effect :thumbsup:

		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 :

i think with rb+, i will have smoother curves and a better sound engine

Attached Files

Reply to this topic


0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users