This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-08-27 17:54:06

Borrego6165
Scratcher
Registered: 2011-03-10
Posts: 1000+

Making a drive mode in a city built by player???

I have finished and uploaded my new city-builder, which also includes a U-DRIVE-IT mode, but no matter how many different ways I try to develop the scripts for the cars, they seem as rubbish as each other. Does anyone have time to look at the game's scripts,  and make a car that can be driven (V Small on screen) and can scroll with the city? borregoworld.yolasite.com/scdg.php


Generation:4001 Build a beautiful city, with over 50 objects and over 10000 tiles per city! This simulates traffic, pollution, tourism, crime and more!

Offline

 

#2 2011-08-28 13:37:26

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Making a drive mode in a city built by player???

You'll have to use trig:
change scrollx by sin(direction)*vel
change scrolly by cos(direction)*vel

vel is the speed of the car (controlled by up and down arrows usually)
direction is the direction the car is pointing (duh)
you should also add:
set vel to vel*.99

so that there is a realistic friction for the car.
If you need more help than this, view my trig tutorial.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2011-08-31 10:54:25

Borrego6165
Scratcher
Registered: 2011-03-10
Posts: 1000+

Re: Making a drive mode in a city built by player???

thanks. i bet you've noticed all the glitches in it from FreeCity Designer (the new name for it) hope you do try it out though, I need feed back on my work to get better.


Generation:4001 Build a beautiful city, with over 50 objects and over 10000 tiles per city! This simulates traffic, pollution, tourism, crime and more!

Offline

 

#4 2011-08-31 19:35:16

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Making a drive mode in a city built by player???

Oh, I never actually looked at the project, so I'll do that now.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

Board footer