Author |
Message |
isaiahk9
|
Posted: Tue May 13, 2008 6:25 am Post subject: Is shielding/blocking possible in a fighter game? |
|
|
Basically the topic line. Ive tried several times in different ways to make a shield (while the user holds teh 'shield key' they cannot be hurt), but so far no luck. Manipulating the character's health in the fighter game hasn't worked. Does anyone know how I would make a shield/block control for the character?
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Mackie
|
Posted: Tue May 13, 2008 6:42 am Post subject: RE:Is shielding/blocking possible in a fighter game? |
|
|
That's a very open ended question. Do you have any code we can work off of? Without code, I can almost guarantee, most people will respond with sarcastically simple code that doesn't really help.
|
|
|
|
|
|
isaiahk9
|
Posted: Tue May 13, 2008 7:04 am Post subject: Re: Is shielding/blocking possible in a fighter game? |
|
|
k, i get it. ill post a version of my code when i get home at around 6.
|
|
|
|
|
|
isaiahk9
|
Posted: Tue May 13, 2008 11:53 am Post subject: Re: Is shielding/blocking possible in a fighter game? |
|
|
i got my code faster than i thought, here is a demo version. Sorry its without pictures/sound. Youll only be able to look at the code. In this demo, shielding heals you. I want to make it negegate enemy attacks. Anybody know how?
PS. I can send a demo version with pics and sound at 6
Description: |
This is the demo of my game, without sound and pictures. |
|
Download |
Filename: |
game.t |
Filesize: |
14.73 KB |
Downloaded: |
87 Time(s) |
|
|
|
|
|
|
Newguy
|
Posted: Tue May 13, 2008 3:45 pm Post subject: Re: Is shielding/blocking possible in a fighter game? |
|
|
Do you want a shield in front of the person, behind, all around. Need more info.
|
|
|
|
|
|
isaiahk9
|
Posted: Tue May 13, 2008 3:53 pm Post subject: RE:Is shielding/blocking possible in a fighter game? |
|
|
like i said, ill put the pictures out at 6. but if u want to know anyway, its like in Super Smash Brothers - a sort of circle/sphere/shell appears around the character, shielding them from damage
|
|
|
|
|
|
gitoxa
|
Posted: Tue May 13, 2008 3:57 pm Post subject: Re: Is shielding/blocking possible in a fighter game? |
|
|
Processes... bleh. Anyway, about your question. First of all, I don't see any moves for fighting. Granted, I didn't look hard.
As far as I can tell, you're going a super smash bros. type game. Why not make a shield along the same lines of that. By that I mean absorbs a set amount of damage, and recharges overtime/after a set amount of time. That, or you could make it negate one attack (or percentage of one), and disappear.
code: | if Shield = true then
DamageTaken := EnemyAttack * <Percentage>
else
DamageTaken := EnemyAttack * 1
end if |
Or however you want to incorporate that into your process ridden code.
|
|
|
|
|
|
Insectoid
|
Posted: Tue May 13, 2008 4:51 pm Post subject: RE:Is shielding/blocking possible in a fighter game? |
|
|
When someone attacks the player , use something like
if (computer player attacks) and not key (shield button) then
do damage
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
isaiahk9
|
Posted: Tue May 13, 2008 6:19 pm Post subject: RE:Is shielding/blocking possible in a fighter game? |
|
|
thanx gitoxa and insectoid! you've helped me alot. I was gonna put the complete demo (pictures and all), which would've be runnable but I just got the "No File Specified" when i tried to attach my .zip. thanx anyway
|
|
|
|
|
|
isaiahk9
|
Posted: Tue May 13, 2008 8:43 pm Post subject: RE:Is shielding/blocking possible in a fighter game? |
|
|
thanx again. Right now i put your concepts into my actual code, and it worked - now the shielding prevents damage.
|
|
|
|
|
|
riveryu
|
Posted: Wed May 14, 2008 4:48 pm Post subject: RE:Is shielding/blocking possible in a fighter game? |
|
|
Just a suggestion, if you want a partial shield(not completely protecting from damage), you can draw an oval or image and use collision detection to determine wether the player hits the sheild or not. Taking it further you may even use your mouse's coords and adjust the position or angle of the shield.
Also,this maybe irrelevant to your question but try using less processes and just do the caculation for both player and draw everything at the end in one huge loop...
|
|
|
|
|
|
isaiahk9
|
Posted: Sun May 18, 2008 6:41 pm Post subject: RE:Is shielding/blocking possible in a fighter game? |
|
|
Processes have never done me any harm . . .
How would you draw everything at the bottom (when you look at my code) - moves and projectiles would be problematic. Would that change anything if I did?
|
|
|
|
|
|
Saad
|
Posted: Sun May 18, 2008 6:48 pm Post subject: Re: RE:Is shielding/blocking possible in a fighter game? |
|
|
isaiahk9 @ Sun May 18, 2008 6:41 pm wrote: Processes have never done me any harm . . .
How would you draw everything at the bottom (when you look at my code) - moves and projectiles would be problematic. Would that change anything if I did?
What you want to do is structure your code such that you handle everything frame by frame (eg Update the positions and draw each new object).
The structure should go something like
Turing: | loop
%% Update
%% Draw
end loop
|
A simple example is Turing: | var x : int := 0
var y : int := maxy
loop
%% Update the stuff here
x + = 1
y - = 1
%% Draw everything here
Draw.Dot (x, y, black)
exit when x > maxx or y < 0
end loop
|
|
|
|
|
|
|
isaiahk9
|
Posted: Sun May 18, 2008 6:53 pm Post subject: RE:Is shielding/blocking possible in a fighter game? |
|
|
but what if I have something like what you mentioned, as well as pictures for moves? For example :
Dark Link has his arrow attack :
he looks normal
he holds a bow
he pulls back the bow
he holds a bow
an arrow shoots out
if it hits the enemy, poison bubbles appear over the enemy
Master Chief has spike grenade :
he looks normal
he drops his grenade
explosion 1 shows up on the grenade
explosion 2 shows up on the grenade
explosion 3 shows up on the grenade
explosion 4 shows up on the grenade
shrapnel pieces A, B, C, D, E fly out in their respective directions
How could I draw all of that with just one View.Update?
|
|
|
|
|
|
Saad
|
Posted: Sun May 18, 2008 7:05 pm Post subject: Re: Is shielding/blocking possible in a fighter game? |
|
|
Again you want to update it frame by frame. Heres a simple code example to show what I mean. If you press space bar then it shall make the circle grow frame by frame.
Turing: | View.Set ("offscreenonly")
var x, y := 250
var radius := 50
var growCircle := false %% This stores whether we need to grow the circle
loop
var keyboardInput : array char of boolean
Input.KeyDown (keyboardInput )
if (keyboardInput (KEY_DOWN_ARROW)) then
y - = 5
end if
if (keyboardInput (KEY_UP_ARROW)) then
y + = 5
end if
if (keyboardInput (KEY_LEFT_ARROW)) then
x - = 5
end if
if (keyboardInput (KEY_RIGHT_ARROW)) then
x + = 5
end if
if (keyboardInput (' ') and not growCircle ) then %% Since space was pressed this means we should make the circle grow
growCircle := true
end if
if (growCircle ) then %% We are growing the circle
%% Frame by frame we update the circle radius
radius + = 1
if (radius > 200) then %% The condition after which we stop
growCircle := false
radius := 50
end if
end if
Draw.FillOval (x, y, radius, radius, black)
View.Update ()
Time.Delay (10)
cls ()
end loop
|
|
|
|
|
|
|
|