Author Topic: Help with Chapter 4 exercises  (Read 1342 times)

0 Members and 1 Guest are viewing this topic.

Offline postie

  • Visitor
  • Join Date: Apr 2015
  • Posts: 1
  • Karma: 0
  • Platform: PC/Steam
Help with Chapter 4 exercises
« on: April 09, 2015, 01:12:22 AM »
Hi,

Can someone share how they completed the exercises at the end of chapter 4?
For exercise 1 I was trying to use random number to choose between 2 polygon shapes but having trouble with the logic statement to pick the array for different shapes when random number is 1 or 2.
For exercise 2 I tried to setup the mouse so that when it is moved in the x direction would rotate left or right based on the x position being positive or negative.
Only just starting to learn java programming so using this book and java documentation on oracle website but got a bit stuck.
« Last Edit: April 09, 2015, 09:12:14 PM by postie »