Samureye - basic fighting engine

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

Samureye - basic fighting engine

Postby DilloDude » Thu Sep 25, 2008 10:34 pm

Here's a basic fighting game I've made over the past week.
samureye.zip
(141.49 KiB) Downloaded 421 times

screenshot.png

Controls
A, D: run left and right.
S: crouch
spacebar: jump
numpad 8, 4, 5, 6: attack

The faster you run, the higher you jump. You also jump higher if you're crouching, so to get maximum height, run fast, then quickly crouch and press jump.
To wall-jump, run at a wall and jump. Press jump again in the air before you hit the wall to kick off it.

Attacking press the attack key in the direction you want to attack in. There are eight attacks:
On the ground:
  • 4/6 (in the direction you're facing): basic kick.
  • 4/6 (the other way): back punch.
  • 5: slide kick.
  • 8: uppercut punch.
In the air:
  • 4/6 (in the direction you're facing): fly kick (hold the key down and then release to attack).
  • 4/6 (th other way): double spin kick.
  • 5: dive kick.
  • 8: double flip kick.
Explanation
The player is made up of four actors:
  • The graphic (the part you see)
  • The actual player actor (purple)
  • A base to detect when you leave the ground (yellow)
  • An attack sensor to do the attacking (red)
The graphic is separate from the player for a few reasons
  • It's easier to have certain areas count as collisions, and others not (ie. If your player carries a sword, you don't want him do pe able to be killed when someone punches the sword)
  • It makes the player a better shape for collisions, so the shape stays the same, especially since in this case, the player is a stick-figure, so lots of things could easily miss him because he's so thin

Actors use the stats variable as a set of bits to know how to interract with each other:
  • bSolid: This is for solid things like walls
  • bAttack: This is for things that are attacks, or do damage; they use the variable 'dir' as the direction the object they should hit should fly, and 'strength' as the strength of the attack (for how fast to make things fly, how much damage to do, etc.)
  • bSide: The 'side' the attack is on (true = enemy, false = you). This is primarily for the making sure you can't hit yourself (you can go flying all over the shop if you disable this check, but once you add health it will get really bad).
  • bUseSide: whether to count bSide (ie. things like balls want to hurt both you and enemies. They have this value false. You have it true. An enemy would also have it true).
So an enemy would have a collision similar to sam_col->collision->any side of any actor (you can add health in yourself) but you'd change the condition
Code: Select all
if ((collide.stats & bAttack) && ((collide.stats & bSide) || (collide.stats & bCountSide) == 0))

to
Code: Select all
if ((collide.stats & bAttack) && (((collide.stats & bSide) == 0) || (collide.stats & bCountSide) == 0))

On his attacks creation, you'd set stats to
Code: Select all
stats = bAttack | bSide | bCountSide;

Conclusion
That's about it for now. At the moment, the game is simple: just run and jump around and have fun smashing balls everywhere.
Graphics were made using Pivot Stick-Figure Animatior and Graphics Gale. Sounds were made in your imagination :wink:
I don't really have any particular plans for future development of this game, so feel free to modify it, add stuff to it and improve it at your leisure (why not have a contest to see who can make the best game from it?) If you have any further questions about how it works, ask here.
That's all for now.

PS: I'm getting weird problems with the key-ups not always being received, especially when lots of them happen at once. Anyone else get this?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: Samureye - basic fighting engine

Postby pyrometal » Thu Sep 25, 2008 11:17 pm

Very well made Dillodude! It's a shame my laptop doesn't have a numpad though... couldn't test the attacks, sorry! I'm sure people will give you feed back about those though. I've used the method you described for spliting the player into parts for a long time now, and it does work very well indeed, but I've always limited myself to 2. I'm impressed! Keep up the excellent work, and keep showing off GE's potential! ttyl

--pyro
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Samureye - basic fighting engine

Postby edh » Fri Sep 26, 2008 12:49 am

Very cool. Reminds me of N or the Portal flash game.

Nicely done.

(The controls suck on my laptop, though. :) I have to hold the fn key to make the keys act like a number pad. gah!)
User avatar
edh
 
Posts: 233
Joined: Thu Sep 13, 2007 12:17 am
Location: Maine, USA
Score: 14 Give a positive score

Re: Samureye - basic fighting engine

Postby DilloDude » Fri Sep 26, 2008 12:59 am

Yeah, I didn't really think about laptop keyboards...
But you can always edit it to change the keys if you want.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: Samureye - basic fighting engine

Postby BlarghNRawr » Fri Sep 26, 2008 2:24 am

edh wrote:Very cool. Reminds me of N or the Portal flash game.

yay N
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Samureye - basic fighting engine

Postby smallville » Sat Sep 27, 2008 12:46 am

VERY NICE! - i like the way the stick man slides when you stop! :lol: :D
good job! +1 from smallville
ReDgame 2009
current projects:
S.W.A.T: a shooter/ freeroamer (sort of) with a unique story and a TWIST
User avatar
smallville
 
Posts: 54
Joined: Mon May 05, 2008 9:05 am
Location: Location: Location: Location: location: Loca....
Score: 3 Give a positive score

Re: Samureye - basic fighting engine

Postby Lexcondran » Sat Sep 27, 2008 8:43 am

wow thats awesome but dude one of the glitches os an issue i cant think of. when the balls hit me i started running nonstop forward and couldnt do anything :o
http://www.mediafire.com/?e4zzycilztdm1qm =My RPG APP FILE V. 3.0 {7/15/2010}
http://www.mediafire.com/?tjjmmmkzyga =My editable demo of my Rpg for people V2.3
viewtopic.php?f=6&t=10247 =Link to my RPG's (4.0) Topic =]
User avatar
Lexcondran
 
Posts: 230
Joined: Thu Jul 31, 2008 6:09 pm
Location: Tucson, Arizona, USA
Score: 8 Give a positive score

Re: Samureye - basic fighting engine

Postby DilloDude » Sat Sep 27, 2008 10:06 am

Yeah, I think that's a problem when a lot of keys are released at once, some keys stay on for some reason. When this happens, you can fix it by pressing the offending key and then releasing it again. I tried various methods to get around this problem but to no avail.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Re: Samureye - basic fighting engine

Postby MrJolteon » Sat Sep 27, 2008 11:02 am

For laptop users(like me) maybe you can use the numbers at the top(below f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 and f12(why do we really have those keys? Answer: They are key shortcuts(like f11 puts internet in fullscreen and f5 updates the site)))
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: Samureye - basic fighting engine

Postby Spidy » Sun Sep 28, 2008 7:31 am

nice game keep it up
Image
VOTE FOR MY SIGNATURE PLEASE.......THANK YOU
User avatar
Spidy
 
Posts: 935
Joined: Tue Aug 14, 2007 1:28 pm
Location: http://www.inatonibai.com
Score: 38 Give a positive score


Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest

cron