Code Monkey home page Code Monkey logo

flutter_n_flame_basics's Introduction

first_app

A new Flutter project.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Content

  • length() : gives us the size/magnitude of the vector
  • random() : generates random vector in the range of (0,0) to (1,1) - Vector2.random()
  • negate() : which reverses the direction of vector.
  • normalized() is normalizes the vector(ie.,it makes magnitude as 1) - Vector2().normalized() * 25
  • To control the magnitude , we could do this: Vector2.random().normalized() * 25

Case Study: ## Vector2 - Random Generation -- First we get the random velocity and set its velocity: velocity = Vector2.random().normalized() * 25; -- Then we set the position of the component to the location we want: position = Vector2(80, 100);

Case Study: ## Vector2 - Angle of Vector We want to do that when we want to know how far a vector has been rotated. Lets call this angle A. The way that we can do this, is by getting a signed angle from a representative vector with 0deg, and take the angle b/w them. -- angleA = v1.angleToSigned(v2);

Case Study: ## Position Component - Angular Momentum We can also have the shape rotated at a certain speed (with refernce to dt- delta time, in the update method) -- angleDelta = dt * rotationSpeed; angle = (angle + angleDelta) % (2*pi);

flutter_n_flame_basics's People

Watchers

Gedela Ravi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.