Card Battle v_0.2 (Updated 1/5/12)

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Card Battle v_0.2 (Updated 1/5/12)

Post by MarekkPie »

Card Battle

I've now updated it so that it at least does something other than taking a dump after two clicks. The cards get redrawn after every play, and the enemy has a relatively simple AI that makes an intelligent decision on what to play.

Right now you won't see much of what is going on unless you play it with the console open. Otherwise, the only thing you can see is the cards changing.

Controls:
Click on a card twice (doesn't have to be a quick double click) in order to play that card. Press space to toggle the hidden cards (this is just to show you what is going on with the wild cards and the enemy hand, will not be in the final game).

How to Play:
You have two cards available to play: an attack card and a defense card. The power of those cards is randomly chosen to be any natural number lower than your current attack/defense stat.

When you have chosen the card to play, they get sent to the stage (currently not visible). If both players played the same card type, i.e. two attacks or two defenses, then the hand gets nullified and the only thing that resolves is the wild cards, which heal/deal direct damage/boost the played card/debuff the played card (visible, but not yet implemented). If the players played opposite card types, then the person who played the card with the highest value, regardless of whether it is an attack or defense card, deals damage to the opposite player equal to the difference between those cards.

The battle ends (NYI) when either player reaches 0 health.

The Scene:
The scene will be where an animated representation of the card game is shown. A player will attack or defend, and react accordingly based on the resolution of the stage. I plan to have 4 different characters to choose from: a goblin, an adventurer, a knight, and a wizard, and all of them will animate in ways that would represent those archetypes well.

CALLING BORED ARTISTS:
As you can see, my art is sub par at best (I think I can handle the cards, but I wouldn't really know how to begin animating a player.) If you would like to help, I'd need quite a few things, but your contribution would help the game tremendously:

There are four player types (goblin, adventurer, knight, and wizard) that all need the several animations:
  • An idle state (while they are waiting for the command);
  • An attack animation;
  • A defend animation;
  • The two above need three subtypes:
  • - A missed animation (for when both players play the same card type, i.e. hide behind shield and peek out, wondering what happened.)
  • - A successful resolution (your attack hits)
  • - A failed resolution (you get hit)
  • A death animation;
  • A victory animation.
I want the overall style to be pixel art. The characters will be viewed from the side at all times, so don't worry about different directions (I know their dominant hands will be switched but whatever). The overall tone of the images needs to be comical. And try and be compact (like FFIII sprites as opposed to like...Final Fight or something.)

To do:
Implement the wild card system
Implement the experience system
Implement the inventory system
Add better art
Give a better representation of what is occuring

OCuXZ.jpg
OCuXZ.jpg (68.85 KiB) Viewed 549 times
Attachments
Card_Battle_v0.2.love
Updated 1/5/12
(801.08 KiB) Downloaded 197 times
RPG Card Battle.odt
(22.54 KiB) Downloaded 153 times
Last edited by MarekkPie on Fri Jan 06, 2012 5:03 am, edited 1 time in total.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Card Battle v_0.1

Post by Robin »

After a few clicks, I get:
error wrote:Error: [string "states/battle/stage.lua"]:12: slot already filled player
stack traceback:
[C]: in function 'error'
[string "states/battle/stage.lua"]:12: in function 'add'
[string "states/battle/battle.lua"]:152: in function 'playCard'
[string "states/battle/battle.lua"]:254: in function 'mousepressed'
[string "boot.lua"]:1: in function '?'
[string "boot.lua"]:1: in function <[string "boot.lua"]:1>
[C]: in function 'xpcall'
Help us help you: attach a .love.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Card Battle v_0.1

Post by MarekkPie »

MarekkPie wrote:Right now, it just farts after you make a card selection (by double clicking on a card) since I don't have any AI for the NPC player.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Card Battle v_0.1

Post by Robin »

Ah, I didn't know you meant erroring by farting. :P
Help us help you: attach a .love.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Card Battle v_0.1

Post by MarekkPie »

Lol. That's O.K. I usually give things anthropomorphic features when I talk about their faults. "Dies", "farts", "throws up", that sort of thing.

I was thinking about the way in which I'd implement the NPC AI for this, and I've got some idea of how to make a "perfect" playing AI, and now I am having trouble abstracting a way to make it dumb. For example, I want all the goblin characters to be fairly dumb, the knights to be standard, and the wizards to be smart.

What I am thinking about is throwing in a dice roll for every if-else clause that weighs down (makes it more likely) the dumb choice. However, I have a feeling that if I have more than two choices, the abstraction of the AI would make it a bit more difficult.

Here's an example of a simple test

Code: Select all

-- First check the stats of the other player
local dStat = player.att - player.def
local rand = math.random()
if rand < (0.5 + dumbWeight) then
	store(dStat * -1) 	-- Misreads the stats and thinks the smaller
						-- stat is the more powerful one.
else
	store(dStat)
end
User avatar
Ghuntar
Prole
Posts: 29
Joined: Wed Nov 25, 2009 8:56 am

Re: Card Battle v_0.1

Post by Ghuntar »

Nobody answered Minsc ? o_O ?

Ghuntar.
Crazy Little Thing Called LÖVE.
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Card Battle v_0.1

Post by MarekkPie »

"Camaraderie, adventure, and steel on steel. The stuff of legend! Right, Boo?" (*squeak!)
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Card Battle v_0.2 (Updated 1/5/12)

Post by MarekkPie »

Updated the first post with a new (working but pretty vacant) build. Also, asking for any artistic help for animating the scene (as explained in the first post).
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Card Battle v_0.2 (Updated 1/5/12)

Post by MarekkPie »

Here are a few of my attempts at making some pixel art for the placards, as well as some updates for the card attack and defense icons. I'm a little disappointed in the background for the goblin and the portrait for the wizard. Just not that good at fine hair. Maybe I'll make the strands a bit thicker, but I was going for a Gandalf the Grey, and figured that needed to be fine and coarse.

https://love2d.org/imgmirrur/kTjd0.html
User avatar
MarekkPie
Inner party member
Posts: 587
Joined: Wed Dec 28, 2011 4:48 pm
Contact:

Re: Card Battle v_0.2 (Updated 1/5/12)

Post by MarekkPie »

Here's a sample sprite for the adventurer/thief type. I'm considering trying to do the art myself, but I'm still a bit worried about how to animate it without it looking awful.
PhRyw.png
PhRyw.png (3.16 KiB) Viewed 544 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest