 |
Thats right - a few nights ago, I walk into Kara for the first time. This was not only my first time, but also the first time we - the Quantum Butterflies - had put together a full Kara team. Only half of us were first times, the rest had been rolling with another guild every week and were mostly T4 with some T5 gear.
I could hardly contain myself. I had been working towards this for way too long. I had spent the last few days farming mats for food and buying elixirs. I had done everything I could to prepare myself… but even so, on the first pull I had no idea what was going on. There were so many people. Now don’t think that I hadn’t run any 5-mans before because I had. I had been running at least 1-2 a day for the past 4 weeks, trying to gear myself.
I don’t think any amount of time or effort put into reading about the boss fights, or running 5-mans, could fully prepare you for the coordinated chaos that is a Raid.
We were moving though the pulls like mad men, with the command from the main tank to “hurry up and only drink when I drink.” I was still trying to work out what was going on when I was ask to trap! The marks went up and I was trying to get over the fact that they wanted me to trap, when the MT pulled. I fumbled my way though it and managed somehow to pull off a chain trap, and maintain some sort of dps on the kill order.
It took a long time for things to settle down and for me to get my head back in the game. We one shotted everything, with only one wipe on trash before Curator. We then all laughed it off and just went right ahead and put down Curator. Which we decided was enough for one night on our first guild run of Kara. What can ya say really, other than what a run it was.
We were not expecting much going in, as a lot of us were first timers. I have to give a big thanks to the more experienced guys who made the run go as smoothly as it did.
I will make sure to let you all know on how the second half of Kara goes, just as soon as we decide on a date.
To make it even better, Legacy dropped. Can you say OMG. Also gratz to those who got their first T4 pieces.
Check out more wow content at Hunt This
 |
Extending upon the previous post, while refactoring the Tower class in the Tower Defence I made a mistake that resulted in a rather cool looking bug.
I’d switched over from using the primative types int x; int y to using Point pos to represent internally the position of each Tower.
Now when a monster is detected within the range of the most basic tower, if the gun has reloaded it fires a new bullet using the following code:
bulletArray.add(new JavaTowerDefenceBullet(pos,myMonster.position(),myMonster));
And within the bullet code, we have the move method as follows
lifeSpan--;
int myMove = Math.min(speed, (int) pos.distance(destination));
double distance = pos.distance(destination);
double dxang = Math.acos( (destination.x - pos.x) / distance);
double dyang = Math.asin( (destination.y - pos.y) / distance);
int dx = (int) (Math.cos(dxang) * myMove);
int dy = (int) (Math.sin(dyang) * myMove);
pos.translate(dx, dy);
Unfortunately I’d forgotten that I was passing via reference rather than value!
Thus rather than the tower fireing a bullet which moved towers the monster, it was firing ITSELF! And there were flying towers all over the map
A quick change to the Tower code to
bulletArray.add(new JavaTowerDefenceBullet((Point)pos.clone(),myMonster.position(),myMonster));
and it all works as expected. Though in some ways I prefered firing entire towers at the monsters, simply because they’re bigger.
I was wanting to find out how to date (as in find out when it was made) a Pelikan M400 pen as seen here:
http://www.nexternal.com/swisher/images/Blue_FP_500101.jpg
I get as far as “Dating a” and this is what Google suggests:

Not quite what I wanted. Thanks Google!
For everyone who ever wanted conclusive proof that I’m an idiot. At the moment I’m currently working on the Java Tower Defence game, which is slowly progressing along, if you’re lucky it should be released later this week with the C# and XNA versions following. Hopefully Abhishek can get a Clojure version working and everyone will be happy. I’ve gone a little bit more overboard this time, rather than writing the simplest Tower Defence I could I’ve been writing a slightly more extendable version so people can have fun with it.
Anyway last night I was working on the pathing code for the Monsters.
This is seemingly a trivial piece of code.

Read the rest of this entry »
So.
That time of the night.
Basically.
This is not a good post. This is not an interesting post. It does not contain sex, lesbians, cake, naughty pictures, whips or cheerleaders. It does not have naughty pictures of lesbian cheerleaders with whips eating cake. No. It does not. It is not safe for work either.
Well it started with http://www.amazon.com/8-inch-Forced-Tactical-zipper-Police/dp/B000GYA80M/ref=pd_sbs_a_5 and the fact the “8-inch-Forced” is not a URL I’d go to for at least another 37 minutes.
0:29 Prawn: I don’t need no woman folk!
0:29 Prawn: I has pens and tea!
…
0:30 DarkSentinel Prawn: I almost read that as “I don’t need no woman folk! I has penis and tea!”
So, yeah. It’s that time again. 12:36am. seems like only yesterday that it was.
Yeah.
Wtf. Were you expecting content?

This post was brought to you by the letter M.
 |

XNA Version of Snake Source Code Download
A bit bigger than some of the others, but it’s using textures unlike the original smaller snake.
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
| using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
namespace SnakeXNA
{
static class Program
{
static void Main(string[] args)
{
using (SnakeXNA game = new SnakeXNA())
{
game.IsFixedTimeStep = true;
game.TargetElapsedTime = new TimeSpan(500000);
game.Run();
}
}
}
public class SnakeXNA : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
private static Random myRnd = new Random();
private Point apple = new Point(myRnd.Next(64 - 1) * 10, myRnd.Next(48 - 1) * 10);
private Point dir = new Point(0, 10);
private LinkedList<Point> snake = new LinkedList<Point>(); //LinkedList doesn't have add...
private Texture2D mySquare; //In XNA we need a texture to draw stuff with
private Boolean isRunning = true;
public SnakeXNA()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
protected override void Initialize()
{
snake.AddFirst(new Point(10, 10));
base.Initialize();
}
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
mySquare = Content.Load<Texture2D>("GameThumbnail");
}
protected override void Update(GameTime gameTime)
{
KeyboardState myState = Keyboard.GetState();
if (myState.IsKeyDown(Keys.Left)) { dir = new Point(-10, 0); }
if (myState.IsKeyDown(Keys.Right)) { dir = new Point(10, 0); }
if (myState.IsKeyDown(Keys.Up)) { dir = new Point(0, -10); }
if (myState.IsKeyDown(Keys.Down)) { dir = new Point(0, 10); }
if (isRunning)
{
snake.AddFirst(new Point(snake.First.Value.X + dir.X, snake.First.Value.Y + dir.Y));
snake.RemoveLast();
}
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
spriteBatch.Draw(mySquare, new Rectangle(apple.X + 2, apple.Y + 2, 5, 5), Color.Green); //Draw apple.
int i = 0;
foreach (Point cur in snake) //Draw snake and check self collision
{
spriteBatch.Draw(mySquare, new Rectangle(cur.X , cur.Y , 10, 10), Color.White);
if (i != 0 && snake.First.Value.X == cur.X && snake.First.Value.Y == cur.Y) { isRunning = false ; }
i++;
}
if (snake.First.Value.X == apple.X && snake.First.Value.Y == apple.Y) //Collision apple
{
apple = new Point((myRnd.Next(64 - 1)) * 10, (myRnd.Next(48 - 1)) * 10);
snake.AddLast(snake.Last.Value);
}
spriteBatch.End();
base.Draw(gameTime);
}
}
} |
 |
Now with full initialization. Tomorrow I should have XNA up as well. Then I’ll get to work on a simple tower defense game. Smaller Snake in C#

Executable Download
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
59
60
61
62
63
| using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace SnakeCSharp
{
public partial class SnakeCSharpWindow : Form
{
private Timer t = new Timer();
private static Random myRnd = new Random();
private Point apple = new Point(myRnd.Next(64-1) * 10, myRnd.Next(48-1) * 10);
private Point dir = new Point(0, 10);
private LinkedList<Point> snake = new LinkedList<Point>(); //LinkedList doesn't have add...
public SnakeCSharpWindow()
{
this.ClientSize = new System.Drawing.Size(640, 480);
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.Name = "SnakeCSharpWindow";
this.Text = "SnakeCSharp";
this.Paint += new PaintEventHandler(SnakeCSharpWindow_Paint);
this.KeyDown += new KeyEventHandler(SnakeCSharpWindow_KeyDown);
t.Tick += new EventHandler(t_Tick);
t.Start();
snake.AddFirst(new Point(10,10));
}
void SnakeCSharpWindow_KeyDown(object sender, KeyEventArgs e) //Change direction
{
if (e.KeyCode == Keys.Left) {dir = new Point (-10,0 );}
if (e.KeyCode == Keys.Right) {dir = new Point(10, 0);}
if (e.KeyCode == Keys.Up) {dir = new Point(0, -10);}
if (e.KeyCode == Keys.Down) {dir = new Point(0, 10);}
}
void SnakeCSharpWindow_Paint(object sender, PaintEventArgs e)
{
e.Graphics.FillRectangle(Brushes.Green, apple.X + 2, apple.Y + 2, 5, 5);
int i = 0;
foreach (Point cur in snake) //Draw snake and check self collision
{
e.Graphics.FillRectangle(Brushes.Black, cur.X, cur.Y, 10, 10);
if (i != 0 && snake.First.Value.X == cur.X && snake.First.Value.Y == cur.Y ) { t.Stop(); }
i++;
}
if (snake.First.Value.X == apple.X && snake.First.Value.Y == apple.Y) //Collision apple
{
apple = new Point((myRnd.Next(64-1)) * 10, (myRnd.Next(48-1)) * 10);
snake.AddLast(snake.Last.Value);
}
}
void t_Tick(object sender, EventArgs e) //Move Snake
{
snake.AddFirst(new Point(snake.First.Value.X + dir.X, snake.First.Value.Y + dir.Y));
snake.RemoveLast();
this.Refresh();
}
}
} |
 |
Preparing for PTQ: Berlin
As stated elsewhere, I can’t actually make it to the Wellington PTQ, and the Auckland one will include Eventide so is entirely a different ballgame. With that in mind, I thought I’d share some more fruits of my deck design, and testing, of the last few weeks. I must mention that the deck design may be a bit more radical than usual (:o) since I’ve been consciously avoiding a tribal theme to the newer decks. Also my playtesting has been limited to around 10 games per deck, due to time contrainsts posed by impending (and current) exams. And since I can’t concentrate on study at the moment, you get this literary masterpiece instead. I must mention that my phone and internet went out around midday today (sunday), and according to Telecom this fault affects around 200 people in my area and will be resolved by around 1900 hours on Tuesday (55 hours later). I’m uncertain what sort of fault takes two working days to fix, but later on Telecom sent me the following helpful text message: “If you service is not restored by: 19:00pm on 24.3.06 call 120.”. That’s right, NZ’s biggest telecommunications provider thinks it’s currently March two years ago, so I probably shouldn’t be surprised that their service is a touch on the unsatisfactory side. I tend to upload this tomorrow at Uni, so if you’re reading this that is probably what happened; additionally I don’t have a chance to check decklists online, so am working from memory, and personal notes.
Read the rest of this entry »
 |
In 35 lines. (It had to be done.)
Here’s a take on Jeremy’s Snake, implemented in Clojure (a Lisp for the JVM). As you can see, I’m still using the same library classes. Only the language is different.
A major difference is that this is the whole application code, including incantations and setup. Excerpting the Snake-specific bits would make it shorter — maybe under 30 lines even.
Still, it is a little messy for the sake of brevity. With a more liberal style, it could be a neat 50-100 line Snake.
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
| (import '(java.awt.event KeyEvent ActionListener KeyListener)
'(javax.swing JPanel JFrame Timer))
(defn gen-apple [] {:x (int (* 790 (. Math (random)))) :y (int (* 590 (. Math (random))))})
(def snake (ref {:body (list {:x 10 :y 10}) :dir {:x 10 :y 0}}))
(def apple (ref (gen-apple)))
(def dirs {(. KeyEvent VK_LEFT) {:x -10 :y 0} (. KeyEvent VK_RIGHT) {:x 10 :y 0}
(. KeyEvent VK_UP) {:x 0 :y -10} (. KeyEvent VK_DOWN) {:x 0 :y 10}})
(defn move [{body :body dir :dir :as snake} & opts]
(merge snake {:body (cons {:x (+ (:x dir) (:x (first body)))
:y (+ (:y dir) (:y (first body)))}
(if (:grow (apply hash-map opts)) body (butlast body)))}))
(defn turn [snake newdir] (if newdir {:body (:body snake) :dir newdir} snake))
(defn collision? [{[b & bs] :body} a]
(and (>= (+ 10 (:x b)) (:x a)) (<= (:x b) (+ 10 (:x a)))
(>= (+ 10 (:y b)) (:y a)) (<= (:y b) (+ 10 (:y a)))))
(defn run-snake []
(let [panel (proxy [JPanel ActionListener KeyListener] []
(paintComponent [g] (proxy-super paintComponent g)
(. g (fillRect (:x @apple) (:y @apple) 10 10))
(doseq p (:body @snake) (. g (fillRect (:x p) (:y p) 10 10)))
(if (collision? @snake @apple)
(dosync (ref-set apple (gen-apple))
(alter snake move :grow true))))
(actionPerformed [e] (dosync (alter snake move))
(. this (repaint)))
(keyPressed [e] (dosync (alter snake turn (get dirs (. e (getKeyCode)))))))]
(doto panel (setFocusable true) (addKeyListener panel))
(doto (new JFrame "Snake") (add panel) (setSize 800 600) (setVisible true))
(. (new Timer 75 panel) (start)))) |
Edit: fixed per cgrand’s comment.