Jump to content
IGNORED

New Prototype - Driving thing


Sporadic

Recommended Posts

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 )
		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.

  • Like 5
Link to comment
Share on other sites

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

 

oups ! its normal :grin: 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 :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 !

  • Like 4
Link to comment
Share on other sites

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 :

https://www.youtube.com/watch?v=Fbky1d0kUXE

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

2Droad.zip

  • Like 4
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...