GithubHelp home page GithubHelp logo

swe-scratch's Introduction

Summary

In this repository is a javascript toy written mostly by swe-agent and gpt4. I didn't write any of the code but I had to fix some of it. The commit log messages indidcate what I did vs what swe-agent did.

http://longstair.com/static/swe-scratch/

swe-scratch's People

Contributors

tecuya avatar

Watchers

 avatar

swe-scratch's Issues

Make an attractor tool

This javascript bouncing ball effect allows the user to draw thousands of circles which bounce off each other and stick together and interact, as the user adjusts gravity and ball size settings.

There is a drop down menu where the user can select from multiple 'tools', such as "add ball" and "explode". We want to add a new item to that menu that is called "implode" which works like explode but as you might guess, it propels nearby balls inward rather than outward from the players click coordinates.

We need an index.html with a canvas javascript effect on it

This repository is going to simply contain an index.html and one or more javsacript source files, and when these resources are served by a web server, it will render "screen hacks" in the user's browser; that is, clever little javascript canvas effects and stuff to please the eye and impress onlookers.

The first issue we want to solve is that our index.html does not exist, nor does any javascript source. To solve this issue, simply create an index.html and make it point to a javascript source file, and make it execute javascript code to draw some kind of effect on a canvas.

You could choose to do a rain effect, or a fire effect, or a plasma effect, or a bouncing ball, etc. It should be simple, we want this to be a small changeset, just create the index.html and create the javascript source and make it draw something.

Improve friction in bouncing ball simulation

This javascript bouncing ball effect allows the user to draw thousands of circles which bounce off each other and interact, as the user adjusts gravity and ball size settings.

In the code there is a variable called damping which controls how much velocity is lost by balls in collisions with walls.

  • Please make this value also control how much velocity is lost by balls in collisions with each other
  • Please add a slider to the controls that lets the user adjust this value. Let the slider go from 0.5 to 1

Make collision detection calculate momentum transfer better

When a small ball in this javascript bouncing ball effect hits a big ball, they behave as if both balls have the same mass. But it seems like you could make it so a small ball has a small effect on a big ball. Please try to make your solution accurate.

Add a slider to control ball size

In this javascript bouncing ball effect, the user can click and drag to create swarms of bouncing balls. We would like to add a slider to the controls that allows the user to control the size of the balls they create. Let them choose any diameter from maybe 1 to 1000?

Let the user draw with balls

There is a javascript bouncing ball canvas effect in this repo.

Currently, when you click and hold the mouse button, balls spawn very fast. But they spawn at the x/y position at which the user clicked, rather than allowing the user to drag and move the pointer as balls are created underneath the pointer.

Can you edit it and make it so the x/y of the created balls is always following the mouse pointer?

Add selectable tool to bouncing ball effect

This javascript bouncing ball effect allows the user to draw thousands of circles which bounce off each other and interact, as the user adjusts gravity and ball size settings.

Today, the user has two primary interactions:

  1. The user can click to create new balls
  2. The user can click a button to explode a random ball

I would like to make it so there is a drop-down "tool select" select box in the HTML which allows the user to choose between two tools:

  1. Add ball
  2. Explode ball

The "Add ball" tool is the same thing that happens today when the user clicks. The "Explode" tool will use the existing explosion effect from the "explode a random ball" button, centered on where the user clicks, to propel nearby balls away from where the user clicks.

Add temperature / average kinetic energy display

This javascript bouncing ball effect allows the user to draw thousands of circles which bounce off each other and interact, as the user adjusts gravity and ball size settings.

It has a circle counter. Next to the circle counter, can we make it display a numeric "Temperature" indicator that quantifies the 'average kinetic energy' of the system in a way that is easily digestible to the user? It should take the balls "mass" (in this simulation, mass is equivalent to size) in to account. A big ball moving quickly represents a higher average kinetic energy then a small ball moving quickly, right?

Balls should be varying shades of blue

We want there to be more variety so make the balls have different shades of blue, a whole bunch of different shades of blue, just make sure they are visible against their white background.

Sometimes temperature says NaN

This javascript bouncing ball effect allows the user to draw thousands of circles which bounce off each other and interact, as the user adjusts gravity and ball size settings.

When adding balls, sometimes the "temperature" indicator that shows 'average kinetic energy' of the balls in the system will say NaN. But sometimes it works perfectly. Once it shows NaN, it stays NaN. Please make it show the current 'temperature' more reliably.

Add a control to toggle gravity

This repo contains a javascript effect showing animated bouncing balls. I want you to add a new clickable control to this page that will toggle a "gravity" effect on and off, where the balls are accelerated downwards when gravity is on, and they behave the same way they currently do when gravity is turned off.

Balls falling through the bottom of the floor

In this javascript bouncing balls animation, the balls bounce off the floor, but when they settle, they fall through it. There needs to be some kind of extra code to keep the balls from exiting the canvas area? Or maybe it would be better to adjust some constants? You decide.

add collision detection

It would be sweet if the balls bounced off each other. Can you add rudimentary collision detection so they bounce off each other?

Change gravity control in to a slider

Please alter this javascript bouncing ball effect so that rather than gravity being something the user can toggle on and off, it is controlled by a slider. Make the slider's lowest value 0, and highest value equal to the current 0.5 gravity acceleration constant, which is very strong.

Add a circle counter

This javascript bouncing ball effect allows the user to draw thousands of circles which bounce off each other and interact, as the user adjusts gravity and ball size settings.

The controls appear as a top bar on the browser and the canvas below the controls shows the effect. On the top bar, please add a circle counter that updates in realtime as the user adds new circles.

Better wall physics in bouncing ball animation

This javascript bouncing ball effect allows the user to draw thousands of circles which bounce off each other and interact, as the user adjusts gravity and ball size settings.

Balls keep getting stuck on the walls, and it seems like they are bouncing more when their center hits the edges rather than the edge of the balls. Is there some wall bounce geometry that can be improved?

Balls should never bleed off the edge of the screen in any direction, they should bounce before that happens, see if you can make that impossible.

Make a button that causes a random ball to "explode"

Add a button to the controls for the javascript bouncing ball effect in this repo. When this button is pressed, it should make a random ball "explode". The explosion effect should simply remove the ball that is being exploded, and it should find all the balls that were nearby that ball and add velocity to them to propel them away from the ball that "exploded".

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.