Jump to content

KaladinsSenseOfHumourSpren

Members
  • Posts

    3052
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by KaladinsSenseOfHumourSpren

  1. Liquid Nitrogen. It's really hot here, and I need some refreshment. Why have to returned to the stone age?
  2. A gravity simulation I made. function setup() { createCanvas(800, 800, $("#main")) setInterval(draw2, 5); noStroke() } let particles = [[0, 0, 0, 0, 50]]; let newParticles = [...particles]; const gravitational_constant = 2; //Randomly spawns particles on the canvas function addDust(num) { for (let i = 0; i < num; i++) { let x = [Math.random() * 400 - 200, Math.random() * 400 - 200, Math.random() * 2 - 1, Math.random() * 2 - 1, 0.1] particles.push(x) newParticles.push(x) } } //Randomly spawns particles in a disk around the star, and gives them a random velocity that should make most of them orbit the same direction function addAccretionDisk(num) { for (let i = 0; i < num; i++) { let a = Math.random() * 2 * Math.PI; let x = [(Math.random() * 200 + 100) * Math.cos(a), (Math.random() * 200 + 100) * Math.sin(a), (Math.cos(a) - Math.cos(a + 0.1)) * Math.random() * 10, (Math.sin(a) - Math.sin(a + 0.1)) * Math.random() * 10, 0.05] particles.push(x) newParticles.push(x) } } addAccretionDisk(600) function draw2() { console.log(particles.length); background(0, 20) push() translate(400 - particles[0][0], 400 - particles[0][1]) let count1 = 0 for (p of particles) { count1++; if (p[4] > 30) { //draw stars colorMode(HSB, 100, 100, 100, 100) fill(p[4] - 30, 100, 100) ellipse(p[0], p[1], Math.sqrt(p[4] / Math.PI) * 10) fill(p[4] - 30, 100, 100, 5) ellipse(p[0], p[1], Math.sqrt(p[4] / Math.PI) * 11) fill(p[4] - 30, 100, 100, 5) ellipse(p[0], p[1], Math.sqrt(p[4] / Math.PI) * 12) fill(p[4] - 30, 100, 100, 5) ellipse(p[0], p[1], Math.sqrt(p[4] / Math.PI) * 13) fill(p[4] - 30, 100, 100, 5) ellipse(p[0], p[1], Math.sqrt(p[4] / Math.PI) * 14) fill(p[4] - 30, 100, 100, 5) ellipse(p[0], p[1], Math.sqrt(p[4] / Math.PI) * 15) fill(p[4] - 30, 100, 100, 5) ellipse(p[0], p[1], Math.sqrt(p[4] / Math.PI) * 16) fill(p[4] - 30, 100, 100, 5) ellipse(p[0], p[1], Math.sqrt(p[4] / Math.PI) * 17) colorMode(RGB) } else { //draw planets fill(255) ellipse(p[0], p[1], Math.sqrt(p[4] / Math.PI) * 10) } let count2 = 0; for (p2 of newParticles) { count2++ if (count1 != count2) { let dist2 = Math.pow(p[0] - p2[0], 2) + Math.pow(p[1] - p2[1], 2) //gravity let xgravity = p2[4] * gravitational_constant / dist2 if (p2[0] > p[0]) { p[2] += xgravity } else if (p2[0] < p[0]) { p[2] -= xgravity } let ygravity = p2[4] * gravitational_constant / dist2 if (p2[1] > p[1]) { p[3] += ygravity } else if (p2[1] < p[1]) { p[3] -= ygravity } //collsions if (Math.sqrt(dist2) < Math.sqrt(p[4] / Math.PI) * 5.5) { let x = particles.indexOf(p2) p[2] = (p2[2] * p2[4] / (p[4] + p2[4])) + (p[2] * p[4] / (p[4] + p2[4])) p[3] = (p2[3] * p2[4] / (p[4] + p2[4])) + (p[2] * p[4] / (p[4] + p2[4])) p[4] += p2[4] particles.splice(x, 1) newParticles.splice(x, 1) } } } } particles = [...newParticles] for (p of particles) { //update position based on velocity p[0] += p[2] p[1] += p[3] //Removes particles if they get too far if (dist(p[0], p[1], particles[0][0], particles[0][1]) > 100000) { let x = particles.indexOf(p) particles.splice(x, 1) newParticles.splice(x, 1) console.log(particles.length) } } pop() } Collisions are kind of fixed, though some are still broken. I also have separate roche limit code, but that doesn't work well at all I use p5.js for drawing stuff and jQuery to get the canvas on line 2 @SpiritOfWrath @Usseewa
  3. Ohhhhh a text based game I've made a super simple on before Will the game like, show the map, or does the player have to like explore and stuff
  4. "Ah. And were did you get these concepts from?"
  5. Xyr nodded. "So... since when did you gain the ability to judge an entire species?"
  6. Wait how do you put images in the terminal Also I don't have something to run python in right now, and I probably won't be getting one for a while
  7. Xyr raised an eyebrow at 'your species have been judged'. "Is this an alien invasion?"
  8. Just so that no one's surprised, I have begun school last week, and so I won't be nearly as active as I was during the holidays. I have a little time to Shard before school, and by the time I come back, all you Americans and near-ish timezone folks will either be asleep, or about to sleep.

    1. Myst

      Myst

      Eh, I’ll probably be here for it, I’m Alaskan, so it should overlap for about 2 hours

    2. KaladinsSenseOfHumourSpren

      KaladinsSenseOfHumourSpren

      Oh yeah I checked, it'll be like 8:30 PM or something for you

    3. Myst

      Myst

      Yeah, I’ll be able to chat in SE games or whatever with you.

      but good luck with school, it can get very busy at times

  9. @DragonHeir A door in front of Rebus, and a figure with a white metal-like spike in his left eye walked out. His right eye was Prismatic. "Hello, Rebus," Renamed said. "Named died in a duel in Battle for the Sandwich. I am his successor. I have his memories and his chromaturgy, though I am not a fullborn. This next part if spoilers for the entire Lightbringer Series, so Ashkaloda and others don't read this "I am what is left of Named, and so I am now your employee. Like I said, I don't have Allomancy or Feruchemy, so I am not as powerful as Named, though I do have something he doesn't. Spoilery again "I'd like to start by requesting the modifications that Named had for a constant source of full-spectrum light. I don't know what happened to the nanomachines that Named had, they either were vapourised or are now stuck in Battle for the Sandwich. Or, I guess they could've followed me here."
  10. Xyr got up and rubbed his forehead. Why was he in a cell? Had he dreamed that encounter? It hadn't felt like a dream. He looked around to see the sound of the voice.
  11. Sign me up! I can JS, Python, and pixel art Python is slow though And hard to draw stuff in I can't get a game engine I would not be allowed to download any game engine Folks you know ya'll can use zip() It's even more unreadable, but it's the best Python's got And I don't think JS has it
  12. Old king, forgive us instead So that no more blood is shed Let's have open arms instead
  13. I begrudgingly manifest in front of you. "I guess no one rules the universe," I say. "For now, at least. Bartholomew and Jerome had never left this Thread, but Named had. There are others who must know of his passing. Renamed has gone to tell them."
×
×
  • Create New...