I will add to this during the day each time I encounter annoyingly slow software
- Microsoft Visual Studio 2015 Shell Uninstall. ~1 hour on an I7 laptop with an SSD
| package main | |
| import ( | |
| "github.com/jackmott/rpg/game" | |
| "github.com/jackmott/rpg/ui2d" | |
| ) | |
| func main() { | |
| game := game.NewGame(1, "game/maps/level1.map") |
| type Node interface { | |
| Eval(x, y float32) float32 | |
| String() string | |
| SetParent(parent Node) | |
| GetParent() Node | |
| GetChildren() []Node | |
| SetChildren([]Node) | |
| AddRandom(node Node) | |
| AddLeaf(leaf Node) bool | |
| NodeCount() int |
| x := | |
| if foo { | |
| do_stuff() // returns an int | |
| } else if bar { | |
| a := do_stuff() | |
| print("stuff" | |
| 3*a | |
| } else { | |
| 5 | |
| } |
| package apt | |
| import ( | |
| "github.com/jackmott/noise" | |
| "math" | |
| "math/rand" | |
| "strconv" | |
| ) |
| /* This code ported to Go from Stefan Gustavson's C implementation, his comments follow: | |
| * https://github.com/stegu/perlin-noise/blob/master/src/simplexnoise1234.c | |
| * SimplexNoise1234, Simplex noise with true analytic | |
| * derivative in 1D to 4D. | |
| * | |
| * Author: Stefan Gustavson, 2003-2005 | |
| * Contact: stefan.gustavson@liu.se | |
| * | |
| * | |
| * This code was GPL licensed until February 2011. |
| package main | |
| // Experiment! draw some crazy stuff! | |
| // Gist it next week and I'll show it off on stream | |
| import ( | |
| "fmt" | |
| "github.com/veandco/go-sdl2/sdl" | |
| ) |
| public static void Draw(GameTime gameTime) | |
| { | |
| var effect = DDGame.contentManager.Load<Effect>("road"); | |
| effect.Parameters["TerrainTexture"].SetValue(MainState.level.tex); | |
| effect.Parameters["MaskTexture"].SetValue(MainState.maskTex); | |
| DDGame.batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, effect); | |
| DDGame.batch.Draw(MainState.roadTex, new Rectangle(0, 0, Settings.WINDOW_WIDTH, Settings.WINDOW_HEIGHT), Color.White); | |
| DDGame.batch.End(); | |
| } |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using Microsoft.Xna.Framework; | |
| //Faster linq-style convenience functions https://github.com/jackmott/LinqFaster | |
| using JM.LinqFaster; | |
| namespace DrawAndDrive | |
| { |
I will add to this during the day each time I encounter annoyingly slow software
| let mut finish_line_tex = texture_creator | |
| .create_texture_streaming(PixelFormatEnum::RGB24, | |
| FINISH_LINE_LENGTH as u32, | |
| FINISH_LINE_WIDTH as u32) | |
| .unwrap(); | |
| finish_line_tex.set_blend_mode(BlendMode::Add); | |
| finish_line_tex | |
| .with_lock(None, | |
| |buffer: &mut [u8], pitch: usize| for y in 0..FINISH_LINE_WIDTH { |