Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / A 2d fighting game

Author
Message
Shin Migumi
18
Years of Service
User Offline
Joined: 29th Dec 2006
Location:
Posted: 25th Jul 2007 21:01
Does anyone know f it is posible to code and create a 2d fighting game with darkbasic. I've been scratching my head al week trying to figure out how I would do it. Any ideas?
Dark Dragon
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 26th Jul 2007 22:30
Me to. I tried one,but I didn't succed......
MickeyIII
18
Years of Service
User Offline
Joined: 12th Aug 2006
Location: Louisiana
Posted: 26th Jul 2007 23:32
I've been wanting to do the same thing when I first got DBPro, I'm assuming you're using Pro...If not that's ok cuz the 2d is pretty much the same I believe. Also, I have Gimp 2.2 unless you've got something better...

Now, for the sprites, I like to animate them using seperate images, not the create animated sprite command...I still don't understand it. It never works even in my DBPro 6.3 Update. I'm using 6.3 because NONE of the others work for me, not even just from the disk.

Anyway, what I need to know to work together, if you want, are the following things about the game:

1.)Is this a straight forward fighting game like the old gameboy mortal combat, platform tile scrolling(I have been working on a map editor that's hopefully good enough to get started...),or a top down action scroller?
2.)Is it futuristic, modern, medievil, or magic...Is it like a super hero kind of thing?
3.)What's the title?
4.)Is there a story line? If so, what is it?

Not all of these Have to be answered right away, like the title and story line.

The only reason I jumped from all my other stuff to reply and ask to help eachother is this is the reason why I bought DarkBasicPro in the first place...

If you don't wan't to work with me that's fine to, I'll just work on my own, or get somebody else. Mainly what we need to do is to look at some other source code of similar games, and some simple short tutorials as a guide...

If you prefer email then I don't mind you emailing me...Just put the subject as "fighting game" and I'll know it's you.

Mickey III
Shadow heart
18
Years of Service
User Offline
Joined: 2nd Dec 2006
Location: US
Posted: 27th Jul 2007 03:26
makinga fighting game is extremely complex. the way the fuctions and controls work out there sooo dynamic. ifu kick him in the leg and he jump where will he be hit bac.

haha lets rock this world.
da power pwnerer
18
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 27th Jul 2007 04:01
I would NOT use sprites for this kind of project. I would do:

For attacks, I would make a seperate function for each move. One move, kick, for example"

DO
IF KEYSTATE(31)
KICK(1,2,3,4)
ENDIF

SYNC
LOOP

FUNCTION KICK(FRAME1IMAGE,FRAME2IMAGE,FRAME3IMAGE,FRAME4IMAGE)
SHOW IMAGE FRAME1IMAGE
PASTE IMAGE FRAME1IMAGE,PLAYERX,PLAYERY
WAIT 10
HIDE IMAGE FRAME1IMAGE
SHOW IMAGE FRAME2IMAGE
PASTE IMAGE FRAME2IMAGE,PLAYERX,PLAYERY
WAIT 10
HIDE IMAGE FRAME2IMAGE
SHOW IMAGE FRAME3IMAGE
PASTE IMAGE FRAME3IMAGE,PLAYERX,PLAYERY
WAIT 10
HIDE IMAGE FRAME3IMAGE
SHOW IMAGE FRAME4IMAGE
PASTE IMAGE FRAME4IMAGE,PLAYERX,PLAYERY
WAIT 10
HIDE IMAGE FRAME4IMAGE
ENDFUNCTION

Of course it takes a LOT more pictures, but hey, it works a lot better, in my opinion.

I don't know a lot about 2D collision, so I can't help you out there.

The health bar is a piece of cake to make, so I won't even type the function out. I might make a fighting tutorial whenever I have some more free time


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
da power pwnerer
18
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 27th Jul 2007 06:21 Edited at: 27th Jul 2007 06:23
Quote: "makinga fighting game is extremely complex. the way the fuctions and controls work out there sooo dynamic. ifu kick him in the leg and he jump where will he be hit bac."


If FRAME2IMAGE collides with the enemy Image, then increase the enemy's X and Y. Then subtract the Y 2 fall.

And after that make the enemy picture blink.
Show image blah
wait 10
hide image blah
wait 10
etc

I hope my posts help

EDIT: I would only use sprites in a fighting game for the idle animation


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
MickeyIII
18
Years of Service
User Offline
Joined: 12th Aug 2006
Location: Louisiana
Posted: 27th Jul 2007 17:55
I agree with windows killer, EXCEPT...when I use the create animated sprite command,I get errors such as Image already exists at line such and such on a line where I load another Image.

I'm using 6.3 in DBP because it seems to serve me best, but I think there's something I don't know about using that command, other wise I wouldn't be getting that error.

I'll keep searching the forums, only this time for create animated sprite.
MickeyIII
18
Years of Service
User Offline
Joined: 12th Aug 2006
Location: Louisiana
Posted: 27th Jul 2007 18:30 Edited at: 27th Jul 2007 18:31
Oh!

I forgot about that. Plus I was reading and I was wandering if I should just save the images seperately and use a variable to increase for the frames...I saw a post in the search I did by Zenasem trying to help someone out and that's what he did...



It's kinda pseudo code by the way so DON'T run it!
MickeyIII
18
Years of Service
User Offline
Joined: 12th Aug 2006
Location: Louisiana
Posted: 27th Jul 2007 18:56
Heres a working example...
You need winRar to open it.

Attachments

Login to view attachments
Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 28th Jul 2007 03:04 Edited at: 28th Jul 2007 03:05
why use sprites at all?? There just billboarded plane objects anyway. I say just use actually plane objects and switch textures when needed. You could then add some depth to the game, and even use shaders.

Though, going 3D would open up even more depth to the game. Not only could you have your fighter move freely in 3 dimensions, put you could have limb collision for specific hits and damages. Right now, in order to get something like that with sprites, you have to use a pixel collision plug-in.


Current Project: Blastwave Saga
Completion: 33% (give or take a percentage)
MickeyIII
18
Years of Service
User Offline
Joined: 12th Aug 2006
Location: Louisiana
Posted: 28th Jul 2007 05:08
Um, this is like a sword, fist, or super hero type thing, Like my favorite on GameCube, Soul Calliber II, only 2D like the old Mortal Combat for GameBoy...

Unless Shin meant star ships like Star Wars X-Wing Alliance, I have that game, or Incoming, a cheap arcade game by RAGE. My favorite way to have a vehicle or space sim is to do it like Battle Zone II:Combat Commander,Best game EVER!!! And...........I HAVE IT, TOO!

Anyway with or without Shin, I would like to do a space sim.
It will be called Space Ripper...***Many thought's wiz through my head now...***Yeah, a space sim, I could start simple as for I know how to get ships to follow points in 3D space, and will soon figure out a way to do formations...Only thing is, I use Blender to Model and Export NON-Animated objects successfully into DBPro with no problem, but my UV Mapping skills SUCK!!! I can unwrap a model's UV's in the smart projection option lickity split,but the paint tool that comes with it sucks, too. I know how to export the UV image into The Gimp 2.2, but I can't get the outlines of the Unwraped UV's to "paint" itself in the image so that I know where and what to draw and edit to. I already know about that blender thread in the 3D Chat forum, but it does me no good because I can do more than what they've covered...I think I'll look at some UV mapping tuts and ease my way out of this thread.

Thanks for the Idea

Mickey III
Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 28th Jul 2007 16:34
I've made plenty of "2d" games using 3d objects before. Just check out my retro thread in the PA board. I prefer using 3d, and the command sets for them, rather then using sprites. To me it's less work

Laugh if ya want, was just making suggestions. If you have the basics down, such as command input, combo recognition, character selection, stats, HUDs developed, it's all a mater of setting up the character's animation and movement, either being 2d or 3d, it all has the same functions to work.


Current Project: Blastwave Saga
Completion: 33% (give or take a percentage)
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Jul 2007 00:14
using sprites is fine, but i wouldnt rely on the sprite collision detection use your own variables.

I am King of the noobs!
Shin Migumi
18
Years of Service
User Offline
Joined: 29th Dec 2006
Location:
Posted: 30th Jul 2007 17:56
Thanks for the ideas guys. I'll take all of them into consideration
Dark Dragon
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 30th Jul 2007 22:10
Quote: "
DO
IF KEYSTATE(31)
KICK(1,2,3,4)
ENDIF

SYNC
LOOP

FUNCTION KICK(FRAME1IMAGE,FRAME2IMAGE,FRAME3IMAGE,FRAME4IMAGE)
SHOW IMAGE FRAME1IMAGE
PASTE IMAGE FRAME1IMAGE,PLAYERX,PLAYERY
WAIT 10
HIDE IMAGE FRAME1IMAGE
SHOW IMAGE FRAME2IMAGE
PASTE IMAGE FRAME2IMAGE,PLAYERX,PLAYERY
WAIT 10
HIDE IMAGE FRAME2IMAGE
SHOW IMAGE FRAME3IMAGE
PASTE IMAGE FRAME3IMAGE,PLAYERX,PLAYERY
WAIT 10
HIDE IMAGE FRAME3IMAGE
SHOW IMAGE FRAME4IMAGE
PASTE IMAGE FRAME4IMAGE,PLAYERX,PLAYERY
WAIT 10
HIDE IMAGE FRAME4IMAGE
ENDFUNCTION
"

i would recomend not wait but timer,so the game keeps going smothly.
da power pwnerer
18
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 31st Jul 2007 05:22
Yeah That was just a quick demo of what I thought would be the best way for animations and what-not


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
LBFN
18
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 31st Jul 2007 06:09
Shin Migumi

While I cannot say that I have done a game like what you are thinking about, I have no doubt it could be done in DarkBASIC.

Sprites are designed to handle 2D animation. To show/paste/wait/hide every image for every character seems like a lot of unnecessary work to me and would tend to make your program slug along. I use an array to control animation of the sprites I am using, like this:
dim player(7)

player(1)=200 : ` x coord
player(2)=100 : ` y coord
player(3)=3 : ` status=kicking right
player(4)=20 : ` current image
player(5)=18 : ` lowest numbered image for kicking right
player(6)=24 : ` highest numbered image for kicking right
player(7)=[time] : ` use timer()+25 (for example) - the animation
doesn't change until the timer() reaches it in subsequent game loops

You add 1 to the current image (held in player(4)) every time the timer() reaches player(7) (you then reset player(7)). If the image held in player(4) goes beyond what is held in player(6), you reset the current image (in player(4)) to what is being held in player(5).

You call the sprite by using: sprite number,player(1),player(2),player(4).

Works for me.

LB
Dark Dragon
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 31st Jul 2007 19:56
I agree with LBFN on that.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 31st Jul 2007 21:47 Edited at: 31st Jul 2007 21:55
Quote: "Though, going 3D would open up even more depth to the game."

LOL, what along the Z-axis?

>Following LBFN
You would store all the information for animation length and image numbers for each animation in DATA statements or MEMBLOCKS.

or if you used an image more than once you could do it like this.


I am King of the noobs!
Defy
FPSC BOTB Developer
VBOTB Developer '09
17
Years of Service
User Offline
Joined: 20th Aug 2007
Location:
Posted: 25th Aug 2007 06:06
Theres a Fighter Factory program (sorry no link) that works with sprites, yet im not sure what file types it saves files at, as its used for the 2d fighter engine by Elecbyte. And maybe no use to anyone using DarkBasic.

Shin Migumi - Good luck anyway, I hope it works out for you.

Dark Dragon
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 9th Sep 2007 16:56
man i've been scracthing my head to! this is hard....
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 10th Sep 2007 12:24 Edited at: 10th Sep 2007 12:32
I would mix all of the ideas in this thread so far...

DB Classic firstly has pixel perfect sprite collision, so is ideal.

I would make the game in 3D, because the backgrounds could be 3D models, and would look way better than a 2D background, with the perspective actually working realistcally. It also makes a parrallax scroll easy to add.

I would make the fighters as textured plains, I would create them with Anim8or.

Collision would be hidden sprites, over the top of the fighters. Although the actual fighter can be a whole texture on a plain.. you keep him whole. For collision I would cut the fighter up into seperate parts. Fists, forearms, shoulder/arms, body, head, legs, feet. then check for collisions with the seperate parts. You just place these parts invisibly over the whole plain version of the fighter.

From now on the whole game is easy to make.

(I might post my breakout clone demo, called Barricadium, which uses invisible sprites over plains. It's really fast, and was made with DB Classic)

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Sep 2007 12:37
One small note on collision...

I'd use 2 sets of sprites, like if you had all the images ready, I'd make a copy then draw only the areas that are part of the attack. So if you had a kick, I'd draw the leg on that corresponding sprite. That way you would have hot spots that can be checked for collision, and it'll give a more realistic system. If you were going 3D then you would already have the 3D locations of your feet and fists, but if it's 2D then you should use hot spots.

Otherwise you could attack someone and miss, yet it would still register as a hit, even if the players are merely touching.

We're going down... in a spiral to the ground...
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 10th Sep 2007 15:19
My Barricadium game is in Work In Progress.

Dark Dragon
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 14th Sep 2007 23:18
Quote: "I'd use 2 sets of sprites, like if you had all the images ready, I'd make a copy then draw only the areas that are part of the attack. So if you had a kick, I'd draw the leg on that corresponding sprite. That way you would have hot spots that can be checked for collision, and it'll give a more realistic system. If you were going 3D then you would already have the 3D locations of your feet and fists, but if it's 2D then you should use hot spots.

Otherwise you could attack someone and miss, yet it would still register as a hit, even if the players are merely touching."

why not just have all sprites?

Quote: "My Barricadium game is in Work In Progress."

cool looking forward to it.
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 15th Sep 2007 07:37
Quote: "why not just have all sprites?"


Not sure that you have understood what you have read. I can't make sense of it.

Quote: "cool looking forward to it."


Thanks.

Dark Dragon
17
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 19th Sep 2007 23:08
some media......

Attachments

Login to view attachments
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Sep 2007 10:44
That is kinda vague, sorry bout that...

If you had an animation of a kick for example, I'd copy all the images used for that, then rub out all the bits that aren't dangerous - like maybe just leave the shoes in the copied images. Then if you use DBC sprite collision on the copied images, like just the shoes - then you have a much more accurate system. If you opt for a simple 2 sprite method and try to check collision between them, then every part of the attacking sprite is used, by doubling up with just the dangerous bits as separate sprites you would have to actually hit the opponent properly to register a collision. The other factor is when an attack animation actually should be registered as an attack, if the kick involves moving a leg back a little then swinging it forward, then you might want it to register as an attack only when it's swinging forward.

I'll see if I can find a sprite sheet from SF2 to show what I'm on about...

We're going down... in a spiral to the ground...

Login to post a reply

Server time is: 2025-05-14 16:23:56
Your offset time is: 2025-05-14 16:23:56