Git Product home page Git Product logo

vikid.net's Introduction

vikid.net

Public issue tracking, localisation, documentation and discussion site for https://vikid.net

vikid.net's People

Contributors

ziriax avatar stsbe avatar

Watchers

James Cloos avatar

vikid.net's Issues

rasterize function outputs wrong resolution

See program below, should could 10 pixels...

𝕍i𝕂i𝔻 v0.7-849-g4afd4494 s23
{ ‘⌂’: {* a: 𝕌.paintSolid(#0060FF).under(●.scale(2).render(10, «10», ☒)) } }

Rewind doesn't update hit test lists

See program below, the hit-test list is not updated when rewinding.

𝕍i𝕂i𝔻 v0.7-849-g4afd4494 s23
{ 
  ‘⌂’: {* 
    ‘hit test’: 🏭.mousePosition(☒, ☑).rayCast(∅n, 'paddle', '', ☑),
    ‘speedup factor’: (1.0075),
    speedup📡: 1.merge(speedup.mul(‘speedup factor’).when(‘paddle hit direction’)),
    ‘paddle hits’: 🏭.point2d(ball.track(ball↳‘x﹟1010’), ball.track(ball↳‘y﹟1001’)).rayCast(0, 'paddle', '', ☑).getElement0⧇1().slice(0, 2),
    ‘paddle hit!’: ‘paddle hits’.length().gt(0).merge(☒).rising(),
    ‘paddle hit direction’📡: ‘paddle hits’.sum(☑).when(‘paddle hit!’),
    ball📡: { 
      ‘start speed x’📡: 7,
      ‘start speed y’📡: 11,
      ‘ball radius﹟99’✉📡: (0.25),
      ‘ball diameter﹟101’✉📡: ‘ball radius﹟99’.mul(2),
      ‘ball shape’: ●.scale(‘ball radius﹟99’),
      ‘start right?’: 🏭.randomNumber((-1), 1).gt(0),
      ‘start down?’: 🏭.randomNumber((-1), 1).gt(0),
      vx0: 1.ite(‘start right?’, (-1)).mul(‘start speed x’),
      vy0: 1.ite(‘start down?’, (-1)).mul(‘start speed y’),
      ‘vx﹟543’: vx0.merge(‘vx﹟543’🐢.neg().when(‘paddle hit direction’)).mul(speedup),
      vy: vy0.merge(vy🐢.neg().when(‘bounce y!’)).merge(‘start speed y’.mul(‘paddle hit direction’)).mul(speedup),
      ‘x﹟1010’✉: 0.integral(‘vx﹟543’),
      ‘y﹟1001’✉: 0.integral(vy),
      ‘bounce y!’: ‘y﹟1001’.abs().gte(6.sub(‘ball radius﹟99’)).rising(),
      ‘entity﹟999’: ‘ball shape’.translateX(‘x﹟1010’).translateY(‘y﹟1001’)
    },
    paddles📡: { 
      Controller📡: { 
        docs: 'Side is 
+1 for right, 
-1 for left',
        ‘side﹟9’🔩: 1,
        touches: 🏭.touchTracker(),
        ‘active touches?’: touches.getElement1⧇1(),
        ‘active touches’: touches.item(‘active touches?’),
        ‘side touches’: ‘active touches’.item(‘on side?’),
        ‘on side?’: ‘active touches’.getElement0⧇1().hor⧇1().mul⧇1(‘side﹟9’).gt⧇1(0),
        direction: ‘side touches’.getElement0⧇1().ver⧇1().sign⧇1().sum(☑).sign().calm(☒)
      },
      ‘length﹟106’📡: 3,
      ‘thickness﹟108’📡: (0.5),
      speed📡: 9.mul(speedup),
      offset📡: 8,
      Paddle: { 
        ‘side﹟953’🔩: 1,
        ‘ball diameter﹟919’📡: ball.track(ball↳‘ball diameter﹟101’),
        ‘ball radius﹟1268’📡: ball.track(ball↳‘ball radius﹟99’),
        ‘x﹟951’: offset.mul(‘side﹟953’),
        ‘vx﹟970’: Controller.instance(‘side﹟953’).mul(speed.mul(speedup)),
        ‘y﹟966’: 0.integral(‘vx﹟970’),
        shape: 🏭.figureRect(‘thickness﹟108’, ‘length﹟106’, 0, ⟨0 0 1⟩).filled(#FFFFFF),
        collider: { 
          ‘length/3’📡: ‘length﹟106’.add(‘ball diameter﹟919’).div(3),
          ‘thickness﹟1103’📡: ‘thickness﹟108’.add(‘ball diameter﹟919’),
          Part: { 
            ‘bounce direction’🔩: 1,
            ‘length﹟1296’🔩: ‘length/3’,
            transparency: (0.75),
            ‘part collider’: 🏭.figureRect(‘thickness﹟1103’, ‘length﹟1296’, ‘ball radius﹟1268’, ⟨0 0 1⟩).filled(#FFFFFF).transparentize(transparency).translateY(‘bounce direction’.mul(‘length/3’)).hitRegion('paddle', ‘bounce direction’)
          },
          part1: Part.instance(1, Part↳‘length﹟1296’),
          part2: Part.instance(0, (1.1666666666666667).mul(3)),
          part3: Part.instance((-1), Part↳‘length﹟1296’),
          parts: part1.under(part2).under(part3)
        },
        pos📡: 🏭.point2d(‘x﹟951’, ‘y﹟966’),
        ‘entity﹟942’: shape.over(collider).translateV(pos)
      },
      ‘paddle 1’: Paddle.instance(1),
      ‘paddle 2’: Paddle.instance((-1)),
      ‘scene﹟994’: ‘paddle 1’.under(‘paddle 2’)
    },
    ‘scene﹟648’: «paddles.under(ball)»
  }
}

transparency on composition is very slow

See attached program. When making the composition of the paddle parts transparent, the simulation frame-rate is very slow, even with full transparency. Putting the transparency on each part is fast.

𝕍i𝕂i𝔻 v0.7-849-g4afd4494 s23
{ 
  ‘⌂’: {* 
    ‘speedup factor’: (1.0075),
    speedup📡: 1.merge(speedup.mul(‘speedup factor’).when(‘paddle hit?’)),
    ‘paddle hit?’📡: 🏭.point2d(ball.track(ball↳‘x﹟1010’), ball.track(ball↳‘y﹟1001’)).hitTest('paddle', '', ☑, 0).rising(),
    ball📡: { 
      ‘start speed x’📡: 7,
      ‘start speed y’📡: 12,
      ‘ball radius’✉📡: (0.25),
      ‘ball diameter﹟101’✉📡: ‘ball radius’.mul(2),
      ‘ball shape’: ●.scale(‘ball radius’),
      ‘start right?’: 🏭.randomNumber((-1), 1).gt(0),
      ‘start down?’: 🏭.randomNumber((-1), 1).gt(0),
      vx0: 1.ite(‘start right?’, (-1)).mul(‘start speed x’),
      vy0: 1.ite(‘start down?’, (-1)).mul(‘start speed y’),
      ‘vx﹟543’: vx0.merge(‘vx﹟543’🐢.neg().when(‘paddle hit?’)).mul(speedup),
      vy: vy0.merge(vy🐢.neg().when(‘bounce y!’)).mul(speedup),
      ‘x﹟1010’✉: 0.integral(‘vx﹟543’),
      ‘y﹟1001’✉: 0.integral(vy),
      ‘bounce y!’: ‘y﹟1001’.abs().gte(6.sub(‘ball radius’)).rising(),
      ‘entity﹟999’: ‘ball shape’.translateX(‘x﹟1010’).translateY(‘y﹟1001’)
    },
    paddles📡: { 
      Controller📡: { 
        docs: 'Side is 
+1 for right, 
-1 for left',
        ‘side﹟9’🔩: 1,
        touches: 🏭.touchTracker(),
        ‘active touches?’: touches.getElement1⧇1(),
        ‘active touches’: touches.item(‘active touches?’),
        ‘side touches’: ‘active touches’.item(‘on side?’),
        ‘on side?’: ‘active touches’.getElement0⧇1().hor⧇1().mul⧇1(‘side﹟9’).gt⧇1(0),
        direction: ‘side touches’.getElement0⧇1().ver⧇1().sign⧇1().sum(☑).sign().calm(☒)
      },
      length📡: 3,
      ‘thickness﹟108’📡: (0.5),
      speed📡: 9.mul(speedup),
      offset📡: 8,
      Paddle: { 
        ‘side﹟953’🔩: 1,
        ‘ball diameter﹟919’📡: ball.track(ball↳‘ball radius’).mul(2),
        ‘x﹟951’: offset.mul(‘side﹟953’),
        ‘vx﹟970’: Controller.instance(‘side﹟953’).mul(speed.mul(speedup)),
        ‘y﹟966’: 0.integral(‘vx﹟970’),
        shape: 🏭.figureRect(‘thickness﹟108’, length, 0, ⟨0 0 1⟩).filled(#FFFFFF),
        collider: { 
          ‘length/3’📡: length.add(‘ball diameter﹟919’).div(3),
          ‘thickness﹟1103’📡: ‘thickness﹟108’.add(‘ball diameter﹟919’),
          Part: { 
            ‘bounce direction’🔩: 1,
            ‘part collider’: 🏭.figureRect(‘thickness﹟1103’, ‘length/3’, 0, ⟨0 0 1⟩).filled(#FFFFFF).transparentize((0.5)).translateY(‘bounce direction’.mul(‘length/3’)).hitRegion('paddle', 🏭.tuple2(pos, ‘bounce direction’))
          },
          part1: Part.instance(1),
          part2: Part.instance(0),
          part3: Part.instance((-1)),
          parts: part1.under(part2).under(part3)
        },
        pos📡: 🏭.point2d(‘x﹟951’, ‘y﹟966’),
        ‘entity﹟942’: shape.over(collider).translateV(pos)
      },
      ‘paddle 1’: Paddle.instance(1),
      ‘paddle 2’: Paddle.instance((-1)),
      ‘scene﹟994’: ‘paddle 1’.under(‘paddle 2’)
    },
    ‘scene﹟648’: «paddles.under(paddles).under(ball)»
  }
}

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.