Skip to content

Added movement and action_range - #2

Open
camillettss wants to merge 1 commit into
mainfrom
update
Open

Added movement and action_range#2
camillettss wants to merge 1 commit into
mainfrom
update

Conversation

@camillettss

Copy link
Copy Markdown
Member

movement

il movimento era presente anche prima ma ora non ci si può muovere oltre il proprio range di azione. ci si può muovere illimitatamente però se da 0,0 si vuole andare a 2,0 bisognerà scrivere move 0,1 e di nuovo move 0,2. i movimenti diagonali sono supportati.
syntax:

mv x,y

o

move x,y

action range

come nel movimento non si possono eseguire azioni fuori dal proprio range che è di un tile per lato formando così un quadrato 3*3 il cui centro è il giocatore. operazioni come select non possono andare oltre il range. una volta selezionato il bot se questo cambierà posizione resterà selezionato.

@camillettss camillettss left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didnt checked for bugs :/

Comment on lines +45 to +51
if newx<=self.pos[0]+self.action_range and newx>=self.pos[0]-self.action_range:
if newy<=self.pos[1]+self.action_range and newy>=self.pos[1]-self.action_range:
self.pos=[newx, newy]
else:
print(errs.ActionRangeError(pos=[newx,newy])); return
else:
print(errs.ActionRangeError(pos=[newx,newy])); return

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

action range check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant