My Game

Non-platform specific questions.

My Game

Postby BlarghNRawr » Wed Jun 25, 2008 2:27 am

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)
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: My Game

Postby stevenp » Wed Jun 25, 2008 2:51 am

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
Last edited by stevenp on Wed Jun 25, 2008 3:57 am, edited 3 times in total.
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: My Game

Postby BlarghNRawr » Wed Jun 25, 2008 3:09 am

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)
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: My Game

Postby stevenp » Wed Jun 25, 2008 3:58 am

ok here is an easier way then,

do you know what a timer is, and how to use it?
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: My Game

Postby BlarghNRawr » Sat Jun 28, 2008 3:04 am

ya i basically know how to...
not very well
as my sig reads I R N008
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: My Game

Postby stevenp » Sun Jun 29, 2008 2:55 am

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
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: My Game

Postby BlarghNRawr » Mon Jun 30, 2008 2:32 am

yep
(srry im not on often)
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: My Game

Postby stevenp » Mon Jun 30, 2008 3:36 am

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 )
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: My Game

Postby Thanx » Mon Jun 30, 2008 8:18 pm

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...
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: My Game

Postby stevenp » Mon Jun 30, 2008 8:28 pm

whoops wrong button lol ya thats right :P
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: My Game

Postby BlarghNRawr » Tue Jul 08, 2008 1:09 am

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
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: My Game

Postby stevenp » Tue Jul 08, 2008 1:36 am

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
User avatar
stevenp
 
Posts: 403
Joined: Sat Dec 22, 2007 12:49 pm
Location: canada, ontario
Score: 16 Give a positive score

Re: My Game

Postby BlarghNRawr » Tue Jul 08, 2008 2:08 am

how i make a variable?
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: My Game

Postby Game A Gogo » Wed Jul 09, 2008 2:33 pm

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.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: My Game

Postby BlarghNRawr » Thu Jul 10, 2008 1:54 am

uhhhhh... :? :?
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

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron