<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Markus Willems</title>
    <description>The latest articles on Forem by Markus Willems (@markuswillems).</description>
    <link>https://forem.com/markuswillems</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F73001%2F341cfdb2-d8d0-4871-a513-724c9351ecdc.png</url>
      <title>Forem: Markus Willems</title>
      <link>https://forem.com/markuswillems</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/markuswillems"/>
    <language>en</language>
    <item>
      <title>DEV Contest Entry - Tweng!</title>
      <dc:creator>Markus Willems</dc:creator>
      <pubDate>Thu, 24 May 2018 20:12:25 +0000</pubDate>
      <link>https://forem.com/markuswillems/dev-contest-entry---tweng-223n</link>
      <guid>https://forem.com/markuswillems/dev-contest-entry---tweng-223n</guid>
      <description>&lt;h1&gt;
  
  
  What I built
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Tweng!&lt;/em&gt;, a turn-based card game between two players where each player controls an army that is used to destroy each other on the battlefield!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tweng!&lt;/em&gt; is basically a bad and buggy clone of &lt;em&gt;Gwent&lt;/em&gt; from &lt;a href="https://en.wikipedia.org/wiki/Gwent:_The_Witcher_Card_Game" rel="noopener noreferrer"&gt;&lt;em&gt;The Witcher 3: Wild Hunt&lt;/em&gt;&lt;/a&gt; :D&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdf3h0d338dt2eovpywtf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdf3h0d338dt2eovpywtf.png" alt="Tweng!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo Link
&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://chemical-dock.surge.sh" rel="noopener noreferrer"&gt;http://chemical-dock.surge.sh&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Link to Code
&lt;/h2&gt;

&lt;p&gt;Client: &lt;a href="https://github.com/markus-willems/tweng" rel="noopener noreferrer"&gt;https://github.com/markus-willems/tweng&lt;/a&gt;&lt;br&gt;
Server: &lt;a href="https://github.com/markus-willems/tweng-server" rel="noopener noreferrer"&gt;https://github.com/markus-willems/tweng-server&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  How I built it (what's the stack? did I run into issues or discover something new along the way?)
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;p&gt;I had to create a client as well as a server. For both I used more or less a different stack. Both of course use Pusher.&lt;/p&gt;

&lt;h3&gt;
  
  
  Client stack
&lt;/h3&gt;

&lt;p&gt;The UI I created using React. For building and bundling I used Webpack and a bunch of other cool libs and tools, such as Babel. Check out the package.json for more information. The client is hosted at &lt;a href="http://surge.sh/" rel="noopener noreferrer"&gt;surge&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Server stack
&lt;/h3&gt;

&lt;p&gt;For the server I used Express and PostgreSQL. With Express I created some API endpoints and I used PostgreSQL to persist some match data. Check out the package.json for more information. The server is hosted at &lt;a href="https://openshift.com" rel="noopener noreferrer"&gt;OpenShift&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problems
&lt;/h2&gt;

&lt;p&gt;CSS and UI design is hard. Hats off to people who mastered it! I wanted to add more tests/make it more robust, and refactor the code, since there are a lot of smaller hacks and repetitive code but then I wouldn't have had a working demo until the deadline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons learned
&lt;/h2&gt;

&lt;p&gt;In the future I should probably plan more. I sat down one day and just started hacking without a proper plan laid out. I had the plan in my head - or at least a rough idea of what I am trying to build. But, boy, thorough planning is &lt;em&gt;so&lt;/em&gt; important. &lt;/p&gt;

&lt;h1&gt;
  
  
  Additional Resources/Info
&lt;/h1&gt;

&lt;h2&gt;
  
  
  How to play Tweng!
&lt;/h2&gt;

&lt;p&gt;1.) Visit &lt;a href="http://chemical-dock.surge.sh" rel="noopener noreferrer"&gt;http://chemical-dock.surge.sh&lt;/a&gt;&lt;br&gt;
2.) Create a match/channel and invite a friend via link&lt;br&gt;
3.) Battle each other in turns until someone lost 2 lifes&lt;/p&gt;

&lt;h3&gt;
  
  
  Quick start
&lt;/h3&gt;

&lt;p&gt;Each player has 10 cards during a match. A match consists of at least 2 rounds. A round is over when both players passed the round. The total strength of the army decides who won the round. The player with less strength will lose a life. If both players have the same strength then both will lose a life. Winner is who still has at least one life when the other player lost both.&lt;/p&gt;

&lt;p&gt;To play a card, select it and click the ▲ icon. When a card was played during a round, it won't be available in the next round. Therefore, don't play all your cards during the first round if you plan to win. Be smart.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cards
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Front line
&lt;/h4&gt;

&lt;p&gt;Front line cards are cards displayed as a sword. Front line cards are affected by &lt;em&gt;Frost&lt;/em&gt; cards/spells - their strength is reduced to 1.&lt;/p&gt;

&lt;h4&gt;
  
  
  Mid range
&lt;/h4&gt;

&lt;p&gt;Mid range cards are cards displayed as a bow &amp;amp; arrow. Mid range cards are affected by &lt;em&gt;Fog&lt;/em&gt; cards/spells - their strength is reduced to 1.&lt;/p&gt;

&lt;h4&gt;
  
  
  Long range
&lt;/h4&gt;

&lt;p&gt;Long range cards are cards displayed as a trebuchet (can launch 90kg projectiles over 300 meters). Long range cards are affected by &lt;em&gt;Rain&lt;/em&gt; cards/spells - their strength is reduced to 1.&lt;/p&gt;

&lt;h4&gt;
  
  
  Frost, Fog, and Rain
&lt;/h4&gt;

&lt;p&gt;Reduce the strength of cards. See above which spell affects what cards.&lt;/p&gt;

&lt;h4&gt;
  
  
  Sunshine
&lt;/h4&gt;

&lt;p&gt;Gets rid of frost, fog, and rain. Spells won't any effect anymore. Cards have their normal strength again. &lt;/p&gt;

&lt;h2&gt;
  
  
  Plans for the future
&lt;/h2&gt;

&lt;p&gt;I had a lot of fun hacking and would like to create a rewrite based on the experience I gained during development. This would include better planning, a better architecture, and of course a better UI.&lt;/p&gt;

</description>
      <category>pushercontest</category>
      <category>javascript</category>
      <category>react</category>
      <category>node</category>
    </item>
    <item>
      <title>Tweng - DEV Contest - Current status </title>
      <dc:creator>Markus Willems</dc:creator>
      <pubDate>Tue, 22 May 2018 19:32:18 +0000</pubDate>
      <link>https://forem.com/markuswillems/tweng---dev-contest---current-status--149d</link>
      <guid>https://forem.com/markuswillems/tweng---dev-contest---current-status--149d</guid>
      <description>&lt;h1&gt;
  
  
  Idea
&lt;/h1&gt;

&lt;p&gt;A few months ago I started playing &lt;em&gt;The Witcher 3: Wild Hunt&lt;/em&gt; and instantly fell in love with it. The amount of high quality content that's available is simply insane. Not only the main story but also the hundreds of side quests provide an awesome experience. However, there's one in-game feature (or more, a game) that was so successful that it is currently ported to a standalone game: &lt;em&gt;Gwent: The Witcher Card Game&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Gwent is a turn-based card game between two players, with each game taking three rounds. Each player must play one card each turn from a deck of twenty-five to forty cards. The deck can contain a maximum of four different gold cards and six different silver cards. Gold and silver cards usually have more powerful abilities than bronze cards. Decks can contain a maximum of three copies of bronze cards. Each deck belongs to a faction that offers different play styles. Each faction has different "leaders," which function as Gold cards that can be played at any time, who each have individual abilities. As Gwent does not use a mana system like most traditional CCGs, card advantage is often what wins you the game.&lt;/p&gt;

&lt;p&gt;The goal is to win two of three rounds by playing cards and spells to gain points called "power" on the board. A player wins a round by having more points on board than their opponent. Rounds end when either both players pass to the next round, or when both players run out of cards. The first to win two out of three rounds wins.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Gwent:_The_Witcher_Card_Game#Gameplay" rel="noopener noreferrer"&gt;&lt;em&gt;Gwent: The Witcher Card Game&lt;/em&gt; (Wikipedia)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And this is where I got my idea for the first ever DEV Contest. Even before I became aware that there will be a standalone &lt;em&gt;Gwent&lt;/em&gt; I had the urge of creating a clone using web technologies. Just for fun. But I never actually took action - until two weeks ago! Since then I spent everyday an hour or two on creating a clone I call: &lt;em&gt;Tweng&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tweng&lt;/em&gt; isn't supposed to be a 100% clone, but the basic gameplay should be the same: turn-based card game between two players where each player controls an army with different attributes.&lt;/p&gt;

&lt;h1&gt;
  
  
  What's Pusher doing?
&lt;/h1&gt;

&lt;p&gt;I use Pusher to share &lt;em&gt;actions&lt;/em&gt; with a payload between the players in a channel. An action would be for example &lt;em&gt;playCard&lt;/em&gt; and it's payload is the card that's being played. Another would be &lt;em&gt;passRound&lt;/em&gt; to tell your opponent that you're passing this round.&lt;/p&gt;

&lt;h1&gt;
  
  
  Current status
&lt;/h1&gt;

&lt;p&gt;There is a client written in React and a Node back-end which uses Express (for API endpoints) and PostgreSQL (persisting channels and users).&lt;/p&gt;

&lt;p&gt;This past weekend I worked a lot on &lt;em&gt;Tweng&lt;/em&gt; and was able to create a first playable version! However, there's still a lot of features missing that I would like to add. With some luck before the DEV Contest deadline, but most likely soon afterward.&lt;/p&gt;

&lt;p&gt;What I really want to finish before the deadline is a proper mobile version. During development I tried to keep an eye on both desktop and mobile. But after some time I focused on desktop only to meet the deadline.&lt;/p&gt;

&lt;p&gt;The matchmaking system is currently invite-based. That means you can create a channel and share the invite link with a friend. After your friend joined, you two are ready to play a game of &lt;em&gt;Tweng&lt;/em&gt;!&lt;/p&gt;

&lt;p&gt;So, here it is. A first glance at the current desktop version:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fap3l4p049xetclerv0le.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fap3l4p049xetclerv0le.png" alt="Tweng screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can guess, UI design is hard! So, for now, I only provide a basic layout with some very cool free icons by &lt;a href="https://smashicons.com/" rel="noopener noreferrer"&gt;Smashicons&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Plan for delivery
&lt;/h1&gt;

&lt;p&gt;As I already said before, I am trying to add at least a proper mobile version before the deadline. Also, there are still some minor bugs that need to be fixed.&lt;/p&gt;

&lt;p&gt;Anyway, that's all for now. Thanks for reading and good luck to everyone participating in the contest!&lt;/p&gt;

</description>
      <category>pushercontest</category>
      <category>react</category>
      <category>node</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
