From 225da72f92b9e0b5caded3e0b85de30633af55fb Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 15 Jan 2018 13:59:49 +0100 Subject: finished project 11 --- projects/11/Pong/Ball.vm | 18 +++++++++--------- projects/11/Pong/Bat.vm | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'projects/11/Pong') diff --git a/projects/11/Pong/Ball.vm b/projects/11/Pong/Ball.vm index b8154eb..9d7b984 100644 --- a/projects/11/Pong/Ball.vm +++ b/projects/11/Pong/Ball.vm @@ -86,11 +86,11 @@ return function Ball.setDestination 3 push argument 0 pop pointer 0 -push argument 0 +push argument 1 push this 0 sub pop this 2 -push argument 1 +push argument 2 push this 1 sub pop this 3 @@ -114,21 +114,21 @@ pop local 0 push local 2 pop local 1 push this 1 -push argument 1 +push argument 2 lt pop this 8 push this 0 -push argument 0 +push argument 1 lt pop this 9 goto setDestination.Endif0 label setDestination.Else0 push this 0 -push argument 0 +push argument 1 lt pop this 8 push this 1 -push argument 1 +push argument 2 lt pop this 9 label setDestination.Endif0 @@ -300,7 +300,7 @@ push this 3 push constant 10 call Math.divide 2 pop local 3 -push argument 0 +push argument 1 push constant 0 eq not @@ -313,14 +313,14 @@ push this 2 push constant 0 lt not -push argument 0 +push argument 1 push constant 1 eq and push this 2 push constant 0 lt -push argument 0 +push argument 1 push constant 1 neg eq diff --git a/projects/11/Pong/Bat.vm b/projects/11/Pong/Bat.vm index 23b4033..77acfe4 100644 --- a/projects/11/Pong/Bat.vm +++ b/projects/11/Pong/Bat.vm @@ -66,7 +66,7 @@ return function Bat.setDirection 0 push argument 0 pop pointer 0 -push argument 0 +push argument 1 pop this 4 push constant 0 return @@ -88,7 +88,7 @@ pop pointer 0 push pointer 0 call Bat.hide 1 pop temp 0 -push argument 0 +push argument 1 pop this 2 push pointer 0 call Bat.show 1 -- cgit v1.2.3