VERSAO-FINAL-PAC-BOI
Model was written in NetLogo 5.0.4
•
Viewed 121 times
•
Downloaded 10 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Info tab cannot be displayed because of an encoding error
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
breed [ Jogador ] breed [ capim ] breed [ obstacles ] breed [ Inimigo ] breed [ Bandeira ] breed [caixa] breed [extra] breed [boss] globals [ name level score nextLevel lives aux aux3 maiorscore nextvida aux5 energia controlador] breed [frame frames] to setup ;; (for this model to work with NetLogo's new plotting features, ;; __clear-all-and-reset-ticks should be replaced with clear-all at ;; the beginning of your setup procedure and reset-ticks at the end ;; of the procedure.) __clear-all-and-reset-ticks set level 1 set nextLevel 10 set nextvida 50 set score 0 set lives 3 set aux 14 set aux3 1 set maiorscore 0 set aux5 0 set energia 1000000000 set controlador 0 ask patches [ set pcolor green ] ask patches with [ pxcor > -8 and pxcor < 8 and pycor > 13 ] [ set pcolor cyan ] ask patches with [ pxcor > -8 and pxcor < 8 and pycor < -12 ] [ set pcolor brown ] create-capim 1 [ set shape "leaf" set size 2 set color blue setxy 0 max-pycor - 2 ] create-Jogador 1 [ set shape "cow" set size 3 set color orange setxy 0 min-pycor + 2 ] create-Inimigo 1 [ set shape "bug" setxy 0 max-pycor - 6 set size 3 set color brown set heading 90 ] create-Bandeira 1 [ set shape "flag" setxy 2 max-pycor - 28 set size 2 set color yellow set heading 90 ] create-Bandeira 2 [ set shape "flag" setxy 3.5 max-pycor - 28 set size 2 set color yellow set heading 90 ] create-Bandeira 3 [ set shape "flag" setxy 5 max-pycor - 28 set size 2 set color yellow set heading 90 ] create-Bandeira 4 [ set shape "flag" setxy 6.5 max-pycor - 28 set size 2 set color yellow set heading 90 ] create-Bandeira 5 [ set shape "flag" setxy 8 max-pycor - 28 set size 2 set color yellow set heading 90 ] create-Bandeira 6 [ set shape "flag" setxy -1 max-pycor - 28 set size 2 set color yellow set heading 90 ] create-Bandeira 7 [ set shape "flag" setxy -2.5 max-pycor - 28 set size 2 set color yellow set heading 90 ] create-Bandeira 8 [ set shape "flag" setxy -4 max-pycor - 28 set size 2 set color yellow set heading 90 ] create-Bandeira 9 [ set shape "flag" setxy -5.5 max-pycor - 28 set size 2 set color yellow set heading 90 ] create-Bandeira 10 [ set shape "flag" setxy -7 max-pycor - 28 set size 2 set color yellow set heading 90 ] end to moveJogador fd (0.2 - (level * 0.001)) ask Jogador with [ any? obstacles-here ] [ set score score - 10 set lives lives - 1 die ] ask Jogador [ bounce ] end to novasformigas create-Inimigo 1 [ set shape "bug" setxy 0 max-pycor - 6 set size 1 set color random color set heading 90 ] end to bigboss create-Inimigo 1 [ set shape "bug" setxy 0 max-pycor - 7 set size 8 set color brown set heading 90 ] end to lab_setup ask patch -1 -1 [ set pcolor black] ask patch 0 -1 [ set pcolor black] ask patch 1 -1 [ set pcolor black] ask patch 2 -1 [ set pcolor black] ask patch 3 -1 [ set pcolor black] ask patch 4 -1 [ set pcolor black] ask patch -1 -2 [ set pcolor black] ask patch -1 -3 [ set pcolor black] ask patch -1 -4 [ set pcolor black] ask patch 0 -4 [ set pcolor black] ask patch 1 -4 [ set pcolor black] ask patch 2 -4 [ set pcolor black] ask patch 3 -4 [ set pcolor black] ask patch 4 -4 [ set pcolor black] ask patch 0 -2 [ set pcolor black] ask patch 0 -3 [ set pcolor black] ask patch 1 -2 [ set pcolor black] ask patch 1 -3 [ set pcolor black] ask patch 2 -2 [ set pcolor black] ask patch 2 -3 [ set pcolor black] ask patch 3 -2 [ set pcolor black] ask patch 3 -3 [ set pcolor black] ask patch 4 -2 [ set pcolor black] ask patch 4 -3 [ set pcolor black] end to bounce if (abs [pxcor] of patch-ahead 1 = max-pxcor) [ set heading (- heading) ] if (abs [pycor] of patch-ahead 1 = max-pycor) [ set heading (180 - heading) ] end to advanceLevel if score >= nextLevel [ set level level + 1 user-message "Voce Subiu de level" ask Jogador [ setxy 0 min-pycor + 2 ] ask Inimigo [ setxy 0 max-pycor - 9 ] set nextLevel nextLevel + 10 ] end to InimigoSetup if [pxcor] of patch-ahead 1 = -9 [ set heading (- heading) ] if [pxcor] of patch-ahead 1 = 9 [ facexy -19 11 ] fd 0.3 if controlador = 1 [ask Inimigo[intelig2] ] if controlador < 0 [ask Inimigo[intelig] ] end to coletarvida if score >= nextvida [set lives lives + 1] set nextvida nextvida + 50 end to bossSetup if [pxcor] of patch-ahead 1 = -9 [ set heading (- heading) ] if [pxcor] of patch-ahead 1 = 9 [ facexy -17 11 ] fd 0.1 if level > 1 [ ask boss[intelig] ] end to intelig if aux3 = 1 [set aux aux + 0] if any? Jogador in-radius aux [ set heading (towards min-one-of Jogador [ distance myself]) + random 0.0 if [pxcor] of patch-ahead 1 = -9 [ set heading (- heading) ] if [pxcor] of patch-ahead 1 = 9 [ facexy -19 11 ] ] if [pxcor] of patch-ahead 1 = -9 [ set heading (- heading) ] if [pxcor] of patch-ahead 1 = 9 [ facexy -19 11 ] end to intelig2 if aux3 = 1 [set aux aux + 0] if any? caixa in-radius aux [ set heading (towards min-one-of caixa [ distance myself]) + random 0.0 if [pxcor] of patch-ahead 1 = -9 [ set heading (- heading) ] if [pxcor] of patch-ahead 1 = 9 [ facexy -19 11 ] ] if [pxcor] of patch-ahead 1 = -9 [ set heading (- heading) ] if [pxcor] of patch-ahead 1 = 9 [ facexy -19 11 ] end to scores if score > maiorscore[ user-message " O Maior score é de: " ] user-message name end to energia_setup if energia >= 0 [ set energia energia - 0.002 ] if energia <= 0 [ set lives lives - 1 ] if energia <= 0 [ ask Jogador [ setxy 0 min-pycor + 2 ] ] if energia < 0 [user-message "sua energia acabou , perdeu uma vida "] if energia <= 0 [ set energia energia + 100 ] if score >= nextlevel [ set energia energia + 20 ] end to go if name = 0.0 [ set name user-input "Digite Seu Nome:" user-message " Boa Sorte" ] every 0.1 - (level * 0.001) [ ask Inimigo [ InimigoSetup ] ] ask Jogador with [ any? Inimigo-here ] [ set score score - 15 set lives lives - 1 ] ask Jogador with [ any? Inimigo-here ] [ setxy 0 min-pycor + 2 ] if lives < 1 [ user-message "Voce perdeu não tem mais vidas" stop ] ask Inimigo with [ pcolor = brown ] [ set heading (- heading) ] ask Inimigo with [ pcolor = brown ] [ facexy -19 11 ] ask Inimigo with [ pcolor = cyan ] [ set heading (- heading) ] ask Inimigo with [ pcolor = cyan ] [ facexy -19 11 ] ask Inimigo with [ pcolor = black ] [ rt 0.1] ask Inimigo with [ pcolor = black ] [ rt 0.1] ask Inimigo with [ pcolor = black ] [set controlador 1] ask Inimigo with [ pcolor = green ] [set controlador -1 ] ask Inimigo with [ any? Bandeira-here ] [ set heading (- heading) ] ask Inimigo with [ any? Bandeira-here ] [ facexy -19 11 ] ask Inimigo with [ any? caixa-here ] [ rt 90] ask Inimigo with [ any? caixa-here ] [ rt 90] ask Jogador with [ pcolor = cyan ] [ set score score + 10 ] ask Jogador with [ pcolor = cyan ] [ setxy 0 min-pycor + 2 ] energia_setup advanceLevel end
There is only one version of this model, created about 11 years ago by Erique Souza.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
VERSAO-FINAL-PAC-BOI.png | preview | Preview for 'VERSAO-FINAL-PAC-BOI' | about 11 years ago, by Erique Souza | Download |
This model does not have any ancestors.
This model does not have any descendants.