Page 1 of 2

My Game

PostPosted: Wed Jun 25, 2008 2:27 am
by BlarghNRawr
I wuz making my smash bros. game an HP game, but now that iv found all u smart GE people, u might be able to tell me how to make characters fly farther, the more damage they take in. (if it requires long codes, try to dumb them down or explain them for me, i cant really understand codes theat well)

Re: My Game

PostPosted: Wed Jun 25, 2008 2:51 am
by stevenp
there are many ways you can do this, here is 1 way

( this code was removed, becuase there were too many errors )


basicaly this is a stun attack, that you can set the strength of the distence, and power, now il admit, its pretty late here,

and i am very tired, so im 100% sure this has alot of errors, so il fix it tomorrow, but that is basicaly 1 way

Re: My Game

PostPosted: Wed Jun 25, 2008 3:09 am
by BlarghNRawr
it was to complicated for me to understand, so i diddnt start that part yet.
Iv just been making stages
(i dont even no how global code works)

Re: My Game

PostPosted: Wed Jun 25, 2008 3:58 am
by stevenp
ok here is an easier way then,

do you know what a timer is, and how to use it?

Re: My Game

PostPosted: Sat Jun 28, 2008 3:04 am
by BlarghNRawr
ya i basically know how to...
not very well
as my sig reads I R N008

Re: My Game

PostPosted: Sun Jun 29, 2008 2:55 am
by stevenp
here is 1 way you can do this

you can say

if the damage is 5 ( weak ) he wil be knocked back a little bit
if the damage is 10 ( medium) he wil be knocked back a medium distence
if the damage is 15 ( strong) he wil be knocked back alot

understand so far? if yes i will continue

Re: My Game

PostPosted: Mon Jun 30, 2008 2:32 am
by BlarghNRawr
yep
(srry im not on often)

Re: My Game

PostPosted: Mon Jun 30, 2008 3:36 am
by stevenp
ok, now keep in mind this is NOT!!!! the best way, but it is a reasonably easy way


you need script editor for this, and it means
if the damage is between 0-5 ( and he is on the left side ) it knocks back the player 10 pixles


if(damage >= 0 || damage <= 5) { MoveTo("enemy", -10.000000, 0.000000, 999.000000, "enemy", "");}
if(damage >= 6 || damage <= 10) { MoveTo("enemy", -20.000000, 0.000000, 999.000000, "enemy", "");}
if(damage >= 11 || damage <= 16) { MoveTo("enemy", -30.000000, 0.000000, 999.000000, "enemy", "")}



this is assuming you have a variable called damage, and an enemy called enemy
and you know how to make an enemy take damage

if you understand this i will continue


( the better way of doing it is more efficiant, and accurate, but more complexed )

Re: My Game

PostPosted: Mon Jun 30, 2008 8:18 pm
by Thanx
Watch out there! That code isn't good!!!

stevenp wrote:if(damage >= 0 || damage <= 5) { MoveTo("enemy", -10.000000, 0.000000, 999.000000, "enemy", "");}
if(damage >= 6 || damage <= 10) { MoveTo("enemy", -20.000000, 0.000000, 999.000000, "enemy", "");}
if(damage >= 11 || damage <= 16) { MoveTo("enemy", -30.000000, 0.000000, 999.000000, "enemy", "")}

Instead of || you should use &&.
Why? I'll try and make this clear.
What stevenp is teling your game there is:
If damage variable is greater/equal 0 OR the same variable's smaller than or equal 5 then etc...
If damage variable is greater/equal 6 OR the same variable's smaller than or equal 10 then etc...
If damage variable is greater/equal 10 OR the same variable's smaller than or equal 16 then etc...
ok, with && it won't be OR it'll be AND. Why is this good? The code will always do the third line last, so that's what you'll see.
afterall 0, 5, 10, 11 are all smaller than 16, and any number after that can be higher than 11...

Re: My Game

PostPosted: Mon Jun 30, 2008 8:28 pm
by stevenp
whoops wrong button lol ya thats right :P

Re: My Game

PostPosted: Tue Jul 08, 2008 1:09 am
by BlarghNRawr
kind of get it

but have u guys played smash bros before?
the damage goes up to 999... so would i have to put in another code every 10-30 damage points for every character
P1 and P2?
that would take me days

Re: My Game

PostPosted: Tue Jul 08, 2008 1:36 am
by stevenp
ok since you want it that way, you will need to use another method

use a variable that adds to itself every time you take damage, and use that vaiable as the knock back

Re: My Game

PostPosted: Tue Jul 08, 2008 2:08 am
by BlarghNRawr
how i make a variable?

Re: My Game

PostPosted: Wed Jul 09, 2008 2:33 pm
by Game A Gogo
When in script editor window, you can use the button "Variable" then from there create a new one. do not bother with the array.

An integer type is where a number can only hold wholes. like it can't hold 6.5, it will just turn to 6. When assigning a decimal to these type, it will just wipe it of, so it would be better to use the round() function with these when assigning (just a tip)

A real type is actually a double floating point. where the number can hold decimal up to 12 places (I think)

A string is just like if you were doing "char*Variable", it creates a char with X number of arrays (I have no knowledge of how big the array is). it holds words and such. use the StrCpy function to assign a string to these, you cannot use the good C++ way like MyString='Hello word!'


but all in all, would be better to use integer for this.

Re: My Game

PostPosted: Thu Jul 10, 2008 1:54 am
by BlarghNRawr
uhhhhh... :? :?