Discuss Scratch

squirrel719
Scratcher
69 posts

I need help with my game Race Car Dash 3!!!

Hello, My game Race Car Dash 3!!! is going to have courses that scroll like Za_Chary's Mario Kart 8 project. However I don't know how to make them. My Racecar Dash Deluxe!! and Racecar Dash!! games are earlier versions and they have backdrop courses. However I wanted bigger sized tracks for the new game.


So far my game is just a start menu. However if you press Z a secret start button will appear and it will go towards the car select and cup select which is almost finished. Then you press the Wheel button under ‘Retro’ in the cup select and it will take you to the testing area.

First of all I put the start button when Z is pressed because I wanted to test it myself and not let other people test and get confused.

The game title is called Race Car Dash 3!!! Anounncement Panel and it has these tags:

3 Race Games

I have already finished the car designs and I have added 2 variables for the scroll thing: Scroll X and Scroll Y. Hopefully this makes sense to you.
deck26
Scratcher
1000+ posts

I need help with my game Race Car Dash 3!!!

You haven't actually asked a question.
squirrel719
Scratcher
69 posts

I need help with my game Race Car Dash 3!!!

The question is obvious: Can you help me create the scrolling tracks in my race car game?
deck26
Scratcher
1000+ posts

I need help with my game Race Car Dash 3!!!

I did a x,y scrolling example a little while ago which may help - https://scratch.mit.edu/projects/51479882/
squirrel719
Scratcher
69 posts

I need help with my game Race Car Dash 3!!!

Thanks, but can you try to help my turn it into my game? I have backpacked the cat and the tiles and I am to trying to get them into a race course. I know that the tile layout is something like this:


19 20 21 22 23 24
13 14 15 16 17 18
7 8 9 10 11 12
1 2 3 4 5 6

or it will be 4:3 due to the screen being 360x480.

So the middle tile will become the road and the side parts will be turned into blank spaces…

Also. I am planning 8 tracks, 4 of which are similar to some tracks from Racecar Dash Deluxe!!
deck26
Scratcher
1000+ posts

I need help with my game Race Car Dash 3!!!

But what happens if the two cars on on completely different parts of the track? If you're only displaying the part of the track that the red car is on (and only the adjacent tiles are loaded) the blue car may be out of sight. My project assumes clones are created and deleted as required - it could create clones so both cars have track around them but the visibility problem still exists.

Unless you're planning on this being multiplayer so each player only sees their own car if the other is out of range I don't understand what you're trying to do.
squirrel719
Scratcher
69 posts

I need help with my game Race Car Dash 3!!!

First of all: It is a 2 player game, A WASD controller (red) and a Arrow key controller (blue) for the 2 cars on the same computer
Secondly: I never thought about the cars being in different places out of the scrolling. However I will keep my tracks small so they won't be a massive distance from each other. (about 1.5 times the size of the project screen?)
Finally: If this is a massive problem then I will make this a one-player game… or a two-player game but a car has to be dragged at the bottom of the screen if the other car is moving upwards at the top of the screen… I don't know
squirrel719
Scratcher
69 posts

I need help with my game Race Car Dash 3!!!

Wait. Your coding is that the object doesn't move at all. The world moves around it so with 2 players you can't have that. So I think instead you need four backdrops per course and you go from one to the other by moving the car to the edge of the screen.
deck26
Scratcher
1000+ posts

I need help with my game Race Car Dash 3!!!

squirrel719 wrote:

Wait. Your coding is that the object doesn't move at all. The world moves around it so with 2 players you can't have that. So I think instead you need four backdrops per course and you go from one to the other by moving the car to the edge of the screen.
The only way of being sure both cars is visible is to have the whole track on screen at one time. In any case it will look confusing if it is scrolling in a certain direction to match one player but that doesn't make sense for the other player.

I think you need to think a bit more about what you're trying to make and what makes sense for it.
squirrel719
Scratcher
69 posts

I need help with my game Race Car Dash 3!!!

Well… I guess can only have 1 player for your scrolling code. So the game will have to be 1 player. So all I need is for the scrolling is to put the code from the cat into the race car that I won't remove. and then re draw the tiles and draw them as parts of the road.

I can't really make sense at all but at first I wanted a 2 player racing game with extensive scrolling. But now that will be impossible (or really really hard) so to make the extensive scrolling possible you need to remove the 2nd player, which in this case is the red racecar which is controlled by WASD….
deck26
Scratcher
1000+ posts

I need help with my game Race Car Dash 3!!!

OK, the problem is that the backpack doesn't always recognise whether variables are local or global. ScrollX and ScrollY have to be global and to move the car you're just changing ScrollX and ScrollY.

If you're not showing the mini version of the world you can skip that bit. I'll remix for you.
deck26
Scratcher
1000+ posts

I need help with my game Race Car Dash 3!!!

OK here's a quick remix. https://scratch.mit.edu/projects/59012314/

The cat is only initialising some variables - you could do this elsewhere.

I'll leave you to add the track and colour detection etc.
squirrel719
Scratcher
69 posts

I need help with my game Race Car Dash 3!!!

Thanks. I know how to do colour detection and artist design. But do I just copy the tiles for the other track and would the game work with 3 laps per course? Also I want to know how to get the finish line around… tile 27 or 28 (the grid below is just to help me)

31 32 33 34 35 36
25 26 27 28 29 30
19 20 21 22 23 24
13 14 15 16 17 18
7 8 9 10 11 12
1 2 3 4 5 6
deck26
Scratcher
1000+ posts

I need help with my game Race Car Dash 3!!!

The number of laps is entirely up to you - this is just an extensive scrolling engine.

If you add the finish line to the costume for 27 you can move the car to that position and display ScrollX and ScrollY. Then you can use those as the starting positions which at the moment are set to -1540, -900 in the cat sprite. I think that's all you need to do for that.

For another track (so another set of 6 x 6 costumes) I'd just add more costumes and use an offset for the clones getting their costumes - so offset=0 for the first track and 36 for the second track and you set the clones costume to ‘gen-loop’ plus the offset. That's easier than having another sprite and keeping track of which one is current but if you find that easier it is a possibility.
squirrel719
Scratcher
69 posts

I need help with my game Race Car Dash 3!!!

Im a little confused with how to get the finish line to show at tile 27 only. What do I need to do it?
deck26
Scratcher
1000+ posts

I need help with my game Race Car Dash 3!!!

Each tile is a sprite costume. That costume will only ever show in that position so if you add track and a finishing line to the tile costumes they will appear with the tiles. Alternatively you'd need to give your track components fixed positions in the ‘real world’ and only show them when ScrollX and ScrollY indicate that they should be visible (standard scrolling mechanism essentially).

Adding to the tile will be easiest. If you do so it might be worth re-introducing my code to show the mini version of the world so you can check the track looks sensible. You can get rid of it again later but it will make checking much easier.
squirrel719
Scratcher
69 posts

I need help with my game Race Car Dash 3!!!

I'm really confused, how do you get the tiles to zoom out, which variable controls the zooming? and how do you get the Finish Line to tile 28 ONLY?
deck26
Scratcher
1000+ posts

I need help with my game Race Car Dash 3!!!

You draw the finishing line on tile 28 is the easiest way in the same way as you've already modified some of the tile costumes. I've now done so on my remix. I actually took your existing Finish text, converted to vector and cut and pasted to the tile costume.

There is no variable in my project that controls the zooming, I draw a mini version of the world at the start of the demo using the miniworld custom block which stamps reduced size copies of the sprite costumes in a grid to show what world looks like. That is not necessary for the project so I disabled it in the remix but the code is still there. The easiest way to use it at the moment is to run the game until normal play and stop it. Then go to the sprite with the tiles and run the ‘miniworld’ manually - ie double click that script - but you'll need to tell it to start with the sprite set to costume 1 which is normally done under the green flag.

It would be possible to re-introduce the miniworld at the start automatically but you need to work round your sprites appearing and hiding the stage and delay the world being created which will clone and display the full size tiles.

Powered by DjangoBB