car race

No preview image

This model is seeking new collaborators — would you please help?

1 collaborator

Default-person Ashley Choi (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.3.1 • Viewed 464 times • Downloaded 30 times • Run 0 times
Download the 'car race' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Making the race more interesting (Question)

How can I add things such as speed boosters for the cars (like in mario cart the rainbow floor patch thing that speed up your car)? I also want to add other variables that cause the cars to slow down, such as bananas or something but that would mean that I need to set up a different set of turtles that are not cars. I don't know how to make two groups of turtles with different shapes.... please help

Posted over 7 years ago

Click to Run Model

;Ashley Choi
;IntroCS1 pd08
;HW#51 - Be creative! (Hunger Games Style)
;2016-12-31

to setup
  ca
  ask patches [if pxcor = -15 [set pcolor green]; makes the start line
    if pxcor = 15 [set pcolor white]]; makes the finish line
  crt num_turtles
  ask turtles [set xcor -15]; makes your turtles to be on the start line
  ask turtles [set ycor 16 + who * 33 / num_turtles];Evenly spaces out your turtles so that no two turtles are on the same location
  ask turtles [set heading 90]; Makes your turtles face towards the finish line
  ask turtles [set shape "car top"]
end 

to locomote
  every .1
    [ fd random 10 / 10 ]; basically wiggle but in a straight path
end 

to GO
  locomote
  if xcor >= 15;If the location of one turtle reaches or goes past the finish line
    [ask other turtles [die]]; then the turtles that did not make it to the finish line die
  if count turtles = 1; if there is one turtle left
    [stop]; stop the function
          ;do not know how to incorporate celebratory dance :(
end 


There is only one version of this model, created over 7 years ago by Ashley Choi.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.