summaryrefslogtreecommitdiff
path: root/projects/shooting_the_apple/index.js
blob: 7e3e1854b455315be34cc8b5358070d7e99c9362 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

let t=0;
let vy0=50
let vx0=vy0
let x0=140
let y0=80
let g=9.81

let shooting_the_apple= function (p){
    let width=800
    let height=300
    
    p.setup = function() {
        c=p.createCanvas(Math.min(window.innerWidth,width), height);
       
        
    };
    
    
    p.draw = function() {
        p.clear()
        p.textSize(width/8)
        p.text("TODO",width/5,height/1.5)

    };
    
    p.windowResized = function(){
        p.resizeCanvas(Math.min(window.innerWidth,width), height);
    }
};

refresh=function(){
    t=0
    x0=parseFloat(app.x0)
    y0=parseFloat(app.y0)
    vx0=parseFloat(app.vx0)
    vy0=parseFloat(app.vy0)
    g=parseFloat(app.g)
    p5Load()
}



project_init=function(){
    app = new Vue({
        el: '#app',
        data :{
            x0:x0,
            y0:y0,
            vy0:vy0,
            vx0:vx0,
            g:g
        }
    })
    p5Load()
    
}