archiving works and added posts

This commit is contained in:
Jacob 2017-11-21 10:53:32 +01:00
parent 46ec995394
commit 5146c1f6f4
5 changed files with 49 additions and 9 deletions

View File

@ -24,7 +24,7 @@ const htmlDateLayout = "2006-01-02"
const normalDateLayout = "02 Jan 2006"
var modTime time.Time
var postsCollection []Post
var PostsCollection []Post
func NewPostsCollection() {
verifyFolderModification()
@ -33,14 +33,16 @@ func NewPostsCollection() {
}
func initializeCollection() {
postsCollection = nil
PostsCollection = nil
filepath.Walk("./posts", newPost)
PostsCollection = reversePosts()
}
func acquirePosts(duration time.Duration) {
for {
if verifyFolderModification() == true {
initializeCollection()
PostsCollection = reversePosts()
}
time.Sleep(duration * time.Second)
}
@ -88,7 +90,7 @@ func newPost(path string, f os.FileInfo, err error) error {
template.HTML(string(content[:len(content)])),
}
postsCollection = insertPostAccordingToDate(p, postsCollection)
PostsCollection = insertPostAccordingToDate(p, PostsCollection)
return nil
}
@ -115,17 +117,26 @@ func getDate(n *html.Node) time.Time {
return t
}
func reversePosts() []Post {
length := len(PostsCollection)
s := make([]Post, length)
for i := 0; i < length; i++ {
s[i] = PostsCollection[length-(i+1)]
}
return s
}
func getNewestPosts(numberOfPosts int) []Post {
var posts []Post
l := len(postsCollection)
l := len(PostsCollection)
for i := l - 1; i >= l-numberOfPosts; i-- {
posts = append(posts, postsCollection[i])
posts = append(posts, PostsCollection[i])
}
return posts
}
func getPostByURLTitle(title string) Post {
for _, post := range postsCollection {
for _, post := range PostsCollection {
if post.URLTitle == title {
return post
}
@ -143,6 +154,6 @@ func insertPostAccordingToDate(post Post, arr []Post) []Post {
return s
}
}
postsCollection = append(postsCollection, post)
return postsCollection
PostsCollection = append(PostsCollection, post)
return PostsCollection
}

View File

@ -0,0 +1,13 @@
<iframe width="560" height="315" src="https://www.youtube.com/embed/62nqJxq3E-4" frameborder="0" allowfullscreen></iframe>
<time datetime="2017-03-02">2017-03-02</time>
<p>Two days ago, this trailer was released for <em>Wargroove</em>, a new turn-based strategy game for <em>Switch</em> (and other platforms, but whatever). I, like so many others, lost my shit, since it looks incredibly good and I am fucking <strong>starved</strong> for more <em>Advance Wars</em>. And, let's not kid ourselves: <em>Wargroove</em> is <em>Advance Wars</em> in everything by name, according to the trailer.</p>
<p>Yet, being okay with this, made me wonder</p>
<blockquote>
<p>Why the fuck am I okay with this being a complete rip-off?</p>
</blockquote>
<p>It might be a bit harsh, but I think the developers can handle it. They're making a fantastic looking game that everyone will love. My question above, is really: Why is it sometimes okay to be a blatant rip-off, and sometimes the worst thing ever? <em>Oceanhorn</em> is obviously a rip-off of Zelda, but in that case it makes me go &quot;yuck!&quot;.</p>
<p>There might be several factors, including randomness. Sometimes effort shines through. The original real-time strategy game was <em>Dune 2</em> and being the first, invented a new game genre. Yet for some reason, two years passed before <em>Blizzard</em> released <em>Warcraft: Orcs and Humans</em>, which, by definition almost, had to be considered a rip-off. What probably made a lot of people forgive <em>W1</em>, was that in that age, being a rip-off took a huge amount of effort, and <em>W1</em> is such a better experience to play, that there almost isn't even a comparison to make.</p>
<p>Tile-matching puzzle games too, are a genre rife with rip-offs, and yet some titles are totally forgiven. <em>Dr. Mario</em> shares a playing-field setting with <em>Tetris</em>, but the mechanics of playing it and the aesthetics make it quite different, and saying it was <em>Tetris-like</em> seems like more of a description short-hand than a criticism. <em>Puyo Puyo</em> built on the <em>Dr. Mario</em> mechanics, and based the success of <em>Street Fighter 2</em>, decided the correct way to differentiate itself, was to as visually appealing as SF2, but with the gameplay of <em>Dr. Mario</em>. It's been so popular over the years, that games seem to have to show how they're not just <em>Puyo Puyo</em> rip-offs, even though that itself isn't even that original.</p>
<p>Trying to figure out where some game draws its inspirations form can also lead to embarrassment. <a href="https://rainingblobs.itch.io/raining-blobs"><em>Raining Blobs</em></a> by... Raining Blobs (Really?), initially made me think of it as yet another <em>Puyo Puyo</em>, but speaking to the creator, I became aware of <a href="https://www.youtube.com/watch?v=zK1WChpy58s"><em>Pnickies</em></a>, the far less known <em>Compile</em> (creator of <em>Puyo Puyo</em>) game that <em>Raining Blobs</em> had gotten its mechanics from. Suddenly social situations became a factor in the idea of when something is a rip-off: Some games are hard or impossible to play in certain parts of the world, and Compile were never good at getting their games to the Balkans. If <em>Raining Blobs</em> (the creators, not the game) wanted that sort of gameplay as <em>Puyo Puyo</em> or <em>Pnickies</em> might have, making it themselves was a decent course of action. <em>Raining Blobs</em> (the game, not the creator) by the way, is really good. Like, amazingly tight and stuffed with content and <a href="http://www.whompcomic.com/2014/04/02/kokoro-shaped-box/"><em>kawaii shoujo</em></a>.</p>
<p>So <em>Wargroove</em>? I want it to be the Fantasy Wars to <em>Advance Wars</em>, that <em>Warcraft: Orcs and Humans</em> was to <em>Dune 2</em>. Even if it isn't though, I guess I don't care in this case. It looks great, and <em>Intelligent Systems</em> sure aren't fulfilling my needs right now.</p>

3
posts/March Exam Break Normal file
View File

@ -0,0 +1,3 @@
<iframe width="560" height="315" src="https://www.youtube.com/embed/b0gvM4q2hdI" frameborder="0" allowfullscreen></iframe>
<time datetime="2017-03-04">2017-03-04</time>
<p>I'm going on a short blogging break till later in March (around the 22nd) due to exams. There'll still be a recap tomorrow. For today, let's just enjoy this brilliant analysis by Mark Brown, whom you can always count on for insightful thoughts on video games.</p>

9
posts/Zerudo no CM Normal file
View File

@ -0,0 +1,9 @@
<iframe width="560" height="315" src="https://www.youtube.com/embed/jx2XNA1vM9Y" frameborder="0" allowfullscreen></iframe>
<time datetime="2017-03-01">2017-03-01</time>
<p>#Zeruda no CM</p>
<p>Being admittedly quite hyped for <em>Breath of the Wild</em> on friday, I thought I'd watch_ <em>all of the Japanese Zelda commercials</em>_.</p>
<p>I probably didn't quite manage that though, since there are close to a hundred billion, but I saw at least like... ten. Talking about them is probably more marketing talk than game design, but it's still fun to think about what the commercial makers have been trying to convey. The old commercials could be super campy, like the NES, GB and SNES games, with plenty of over-acting actors and <a href="https://www.youtube.com/watch?v=xYWdi4m4tAM">curiously specific references</a> (Compare to <a href="https://www.youtube.com/watch?v=Trl0cvBFgCk">Link's Awakening</a>).</p>
<p>Another running motif, is to use cute girls to play the game in relaxing manners (<a href="https://www.youtube.com/watch?v=LU3bICBtfXc">Like Shokotan of Pokémon fame and <strong>Gogo Yubari!</strong></a>). This is <a href="https://www.youtube.com/watch?v=ujISFWD7qEM">pretty common for Nintendo games</a> (and games in general, I guess). <a href="https://www.youtube.com/watch?v=tJ88RUdTJdw">This long one for <em>Phantom Hourglass</em></a> is quite endearing, and, really, a bit brave, since it's so slow moving.</p>
<p>My favorite was the one I've used as a header image, for the Wii U hd remake of <em>Wind Waker</em>. It seems to play on the nostalgia that <em>Wind Waker</em> is bound to carry by now, but it's also really refreshing to see the commercial simply say &quot;This game has some amazingly cute characters and great designs, and really, it it brings the world to life&quot;.</p>
<p>Sometimes weird stuff happens. The Ocarina of Time commercials exist in two versions: One showcasing a girl playing the game, one with a boy. Later on though it seems, since the games sold a lot, new ones were released <em>only showing the fucking ending and final battle</em>. Such an odd choice.</p>
<p>The commercials in Japan for <em>Breath of the Wild</em> have so far been a bit uninteresting, although quite useful from a consumer point of view: They show the game. I can't help hoping for some more weird stuff. So hyped for friday.</p>

View File

@ -29,6 +29,7 @@ func main() {
http.HandleFunc("/contact/", contactHandler)
http.HandleFunc("/post/", postHandler)
http.HandleFunc("/", blogHandler)
posts = PostsCollection[:]
if os.Args[1] == "local" {
http.ListenAndServe(":8080", nil)
@ -52,9 +53,12 @@ func blogHandler(w http.ResponseWriter, req *http.Request) {
errorHandler(w, req, http.StatusNotFound)
return
}
posts = getNewestPosts(3)
length := len(posts)
posts = posts[:3]
//posts = getNewestPosts(3)
page := Page{name, posts, "blog"}
renderTemplates(w, page)
posts = posts[:length]
}
func postHandler(w http.ResponseWriter, r *http.Request) {