phamhoaivu911 / ShapeGenerator

Generate random squares, circles, and triangles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ShapeGenerator

Generate random squares, circles, and triangles

Checklist

  • A user should be able to spawn an infinite number of squares or circles filled with random colours or images.
  • Application consists of 4 screens using a tab bar. The tabs are as follows:
  • Squares - this screen only spawns squares.
  • Circles - this screen only spawns circles.
  • Triangles - this screen only spawns triangles.
  • All - this screen spawns squares, circles and triangles randomly.
  • Create squares, circles or triangles which randomly fill with random colours or images when the user taps on the main background.
  • Created shapes are placed at the user's tapped location.
  • Create a shape at a random size within appropriate ranges. A shape should not be more than 45% the width or height of the screen size and should never be less than 10% the width or height.
  • Fill circles with a colour that is generated by calling the API from http://www.colourlovers.com/api/colors/random?format=json using either the RGB or Hex value
  • Fill squares with an image that is generated by calling the API from http://www.colourlovers.com/api/patterns/random?format=json using the imageUrl value
  • Fill triangles randomly either using the fill circle or fill square requirements above.
  • If no connection is available from the above API urls, use code to generate random colours
  • Double tapping the shape replaces the colour or image based on the above mentioned rules.

Extras

  • When a user taps the screen, add an animation for the shapes that appear
  • Remove all shapes when shaking the device
  • Be able to move a shape around
  • Allow a user to use the pinch action to enlarge or shrink the size of a shape
  • Working app for both iOS and Android

Incomplete

  • The current implementation does not draw real circles and triangles. They're still square View with circles and triangles above them. As a result, users cannot press on the remaining View to spawn new shapes.
  • There's an issue with this item. After dragging a shape to another position, then press on its old position. The screen spawns a new shape at the incorrect position.

Screenshots

Screenshot 2023-11-10 at 17 44 07 Screenshot 2023-11-10 at 17 44 04
Screenshot 2023-11-10 at 17 44 02 Screenshot 2023-11-10 at 17 42 58

About

Generate random squares, circles, and triangles


Languages

Language:TypeScript 65.0%Language:Java 18.9%Language:Ruby 6.0%Language:Objective-C 5.9%Language:JavaScript 2.1%Language:Objective-C++ 1.9%