View Full Version : random hits
albigafatony
02-12-2006, 10:27 PM
does any1 know how to make it so u hit at random? and does any1 know how to make it so it hits higher at random if u gain certain levels. I was thinking it would be something like u hit between 0-10 at random then when u lvl its 0-15 or something
also how do u get it so the hp doesnt reset when u enter a new room? - nvm i figured this 1 out
And how do u make it so u cant walk throught things. i made it so i couldnt go through a wall but that was by doing _y = _y += 8 or something
This should be found easily on Google (http://www.google.com/), Please search before asking.
albigafatony
02-12-2006, 11:31 PM
i did
If you didn't find any, then you didn't look properly.
albigafatony
02-13-2006, 12:48 AM
it would be much easier if u didnt keep making up excuses and just told me
Im not making excuses, believe me, at first I kept asking and said I did search really good, but sooner or later, I realised I was wrong.
Dude, what you need coded? I found that before.
Ouch, Pwnt.
albigafatony
02-13-2006, 02:34 AM
wtf ru talking about? stop wasting time on my thread
denacioust
02-13-2006, 03:30 AM
This should be found easily on Google, Please search before asking.
Thats what these forums are for, asking for help, don't just ignore everyone.
You would do something like hit=random(10+level) Something like that but I'm not entirely sure what you want and my Flash isn't working.
For the wall thing you'll need to use a hittest, and I can't teach you cause my Flash is gone.
Make a button and put this on it.(or something like it)
on(release){
_root.enemyhealth-=random(10)+5//means you will take away 5-10 damage.
}
albigafatony
02-13-2006, 05:13 AM
cool thanks
well im gonna go to bed now since i was up all night learning actionscript.
I learned:
how to stop u walking through walls
how to pick up items
how to make ur character set on fire
how to lose hp and get game over when u reach 0
tommorrow i will learn:
how to shoot objects at other objects
how to get my shop thing to work right
how to make the character move easier
albigafatony
02-13-2006, 08:45 AM
ok need help again. How do you make it so the max health is 100? coz i made potions that heal ur health but it puts it above 100 (the potions also start going into minus but i think i can sort that out)
The Brown Cow
02-13-2006, 09:00 AM
Easy. If the value is greater than the maximum, set it to the maximum.
maxhealth = 100;
// for this example, potions heal 10 health. Change to your liking.
// When using a potion...
health += 10;
if (health > maxhealth) {
health = maxhealth;
}
For stopping negative potions, only allow the player to use a potion if they have more than zero of them.
if (potions > 0) {
// Health increasing stuff goes here
}
Yeah, but Even if the forums are for help, we can't do the game for him...We can't help him with ALL of of his needs.
I never got my answer in the past >.>.
albigafatony
02-13-2006, 11:35 AM
all my needs? i only needed help with the health and a few small things
Also how are ppl doing the game for me when i have got:
mapping
walking
healing
losing hp
changing what u look like
picking stuff up
also some things i ask are for different games that i will be making soon and theyre only small things like health or something
MOOGLEFIGHTER
02-13-2006, 12:09 PM
Are you trying to make a rpg engine?
Thats what it looks like.
albigafatony
02-13-2006, 01:12 PM
i think for this game i will make it 1 of those games where u press spacebar to slash and stuff
albigafatony
02-13-2006, 02:56 PM
does any1 know how to duplicate a movieclip at random points like with the walls on the coptor game
Don't double post,
Plus,
all my needs? i only needed help with the health and a few small things
Also how are ppl doing the game for me when i have got:
mapping
walking
healing
losing hp
changing what u look like
picking stuff up
also some things i ask are for different games that i will be making soon and theyre only small things like health or something
...Thats not just a FEW.
The Brown Cow
02-13-2006, 08:08 PM
Tch. He's saying that he took care of all of those things himself, which he did.
Ech, yeah good point, anyway, you can might aswell still search it..-.-.
denacioust
02-14-2006, 06:30 AM
But this is the forum for Flash Game development. You post here and you can ask for help. If he searches he's probably gonna find his answer through an answer someone else had given for the same question on a different forum.
albigafatony
02-14-2006, 07:45 AM
did i ask how to make a duplicate movieclip awhile ago? coz i cant find it here.
edit: woo. just got my shop working. all i had missed out was just 1 little _root
Yeah, don't forget your paths, specially when its on your MC.
Fine fine, I guess the system has changed >.>
albigafatony
02-14-2006, 08:04 PM
just wondering. How do i make a hit test thing. I already have 1 but im not sure if its right. ive got:
if hitTest(_root.object) == true for the hit test of an object, but if the object is a circle then it still hits it like a square
Yes you are tight, but though you don't need the == true thing,
if (hitTest (_root.object)){
//Do stuffness here
}
And for the circle to circle collision, go check at the tutorials section on Brown Cow's site, located at http://www.browncowinternational.com/
albigafatony
02-14-2006, 09:03 PM
no i didnt want the code for what i should put to make stuff happen(wow i made this sentance badly), but thanks for the correction to the hittest. what i meant was when u select an object on .fla it has a square outline thing and when u use the hittest its like u hit the outline instead of the actual object. im probably not saying this at all well
yes, you mean Circle to Circle Collision detection, just goto the site I said.
albigafatony
02-14-2006, 09:31 PM
oh i see. thanks for the help
edit: tried the website tutorial but when i tried making the collision thinkg it didnt work
pm The Brown Cow for help, I don't know much about Circle to circle collision detection.
albigafatony
02-14-2006, 09:50 PM
oh i think im starting to see what i have to do now. the only problem is it seems like ill be adding loads more script to it
edit: woo i got the shop working. now u can buy potions for 15 gold each and if u have less than 14 gold u cant buy it so it doesnt go into the minuses. Also now im adding a person and im not sure how to make it so they walk at random times. Can any1 help with that?
The Brown Cow
02-15-2006, 08:17 PM
Meh? My tutorial totally works. Just remember to add a radius property to each object involved in the collision.
You could also replace that by just using clip._width/2, which will work in most cases.
albigafatony
02-15-2006, 08:19 PM
oh right i didnt think about that. Also now i just want to know how i can save the .fla file and making it so ppl cant just import it into their flash. i know that it wouldnt import the actionscript but i wouldnt want ppl importing stuff i made for some reason
The Brown Cow
02-15-2006, 08:24 PM
Looking to put your file online? You want to share the SWF, not the FLA. Publish the movie (File->Publish) and locate the SWF file in the same folder as the FLA. Upload, email, whatever.
The code is compiled, so people can't just read it, and the graphics are all nicely stuffed in there. There are reverse compilers that can read the data out of it, but I wouldn't worry about people doing that unless your game becomes incredibly popular. I've never bothered with it, and I don't think that XGen does anything about it either.
albigafatony
02-15-2006, 08:34 PM
yeah i know that i need the .swf file but ppl can import the .swf and steal artwork. The drawings are crap it's just i find it annoying when ppl do that
Place a password on the "Protect from Import option" On the publish settings.
TBC, Do I get a thanks for linking to yar' site? :D.
The Brown Cow
02-15-2006, 08:39 PM
Huh, I never knew how easy it was to steal artwork. I'll have to set passwords in the future.
Oh, and yeah. Thanks for the link.
Rofl, I stole a bit of artwork from SRPG2 media, though they were useless for me,
yeah you should set-up some passwords in the future, and Stuart Hart should too.
No prob for zeh linkeh :P.
albigafatony
02-15-2006, 08:45 PM
also i havnt done the actionscript for a button to make it go to my site for so long i dont remember what it is. I have put it as:
on (release) {
getURL("www.guthix.tk", "_self");
}
what should it be?
on (release) {
getURL("www.guthix.tk", "_self");
}
Yes its right, you can also place in _blank for a new page or something like that.
albigafatony
02-15-2006, 09:06 PM
ok any1 wanna test my game? its the first on the list on the games page of my website at www.guthix.tk (http://www.guthix.tk) i must remind u since im mostly using it to learn actionscript i havnt actually worked on the artwork or made much of a point to the game yet. It's a sort of demo
edit: oh w8 the files havnt uploaded onto the ftp yet. The server usually takes awhile
Yay! Free 2 potions! *Enters room and gets Potions* *Exits* *Enters back and repeats samething*
You have to set the _x & _y's up when you hitTest with the Doors,
like if you were in the store and you go down, you would add to the hitTest code
this._x=Wherever the door is;
this._y=Wherever the door is;
albigafatony
02-15-2006, 09:20 PM
you've lost me there
I would say that your map is placed in a MovieClip, and whenever you hit a door or a hotSpot, that map MC would change frames, right?
When it changes frames and like for example your in the middle and the hotspot is in the middle, it changes the frame while your in the middle but the door is all the way to the top.
You getting it?
albigafatony
02-15-2006, 09:33 PM
so adding that code makes it so i appear near the door in the room i enter?
Yes, but don't make it too near, as it might trigger the hotSpot.
If you want, I can do it for 1 room for you.
albigafatony
02-15-2006, 09:40 PM
do you mean send u the .fla for my game and u add it or you make a .fla file with it working?
Yeah, don't worry I won't tamper with it and steal it, I have no point for that,
Just send it to my email @ luivillarias2004@yahoo.co.nz
albigafatony
02-15-2006, 09:47 PM
i'm guessing you wouldnt steal it since u could probably make a way better game than me but can i send an older .fla of the game before i added a load of stuff, but u still enter the areas
Why? Eh, whatever..send it anyway, but now I have to go poopie :D.
albigafatony
02-15-2006, 09:50 PM
ok but also can i send it using the forums or should i just use my email address? my email address is red.stalin@gmail.com
Send it with your email account to mine, so that it would be secure that you wouldn't want anyone else touching the file.
albigafatony
02-15-2006, 09:55 PM
damn google mail being slow. ok im gonna have to use my old email which is no_drinkdriving@hotmail.com
edit: ok u should be recieving it soon
Alright then, Ill get working on it after I go eat lunch.
albigafatony
02-15-2006, 10:00 PM
ok thanks
Oh god, yours is not placed on properly, Ok Ok, I'll fix it LATER when I get the time, this time I will place all the game into one frame and change all your maps into one little MC.
albigafatony
02-15-2006, 10:36 PM
ok thanks. It probably is all in abit of a mess since its my first proper flash game
edit: ok its about 6am now and ive been up all night so i think im gonna go to bed for abit
Oh don't worry, the first time I Tried to create a proper flash game and that was when I was eight. it was screwed up too :P.
albigafatony
02-16-2006, 05:59 AM
ok im back after a good long sleep
LizardRob
02-16-2006, 02:47 PM
how do you know how to make these codes? is it a google search or do you have a website that tells you how to make a stickman game? i would like to know because im going to start makin games, thanks in advance.
arkhan
02-16-2006, 04:14 PM
well..there are milions of sites telling you how to script in flash.
but doing it an knowing it..its diferent...
Learning of course, You can't just expect to know everything from Flash when you open up a tutorial...
Well at least thats what I thought at first >.>
LizardRob
02-17-2006, 04:18 AM
Ive searched loads on google, got any keywords?
denacioust
02-17-2006, 04:40 AM
If you need to know anything just ask us here. Just don't start a new thread for every little problem you get.
First learn the basics of Flash, like MovieClips, Graphics and all those stuff,
when you are ready,
http://www.flashkit.com/
http://www.kirupa.com/
is all I can say.
LizardRob
02-17-2006, 04:47 AM
thanks. and denacious, nobody has made a new thread for this.
Lol, denacioust's name has been hard to spell for a long time, but since my stay here, I'm used to spelling right ;).
There has been people making new threads, but don't worry.
Good luck.
woogala
02-17-2006, 05:19 AM
damn it. It's me albigafatony i cant get on the forums for some reason. Apparently im banned when i havent done anything
denacioust
02-17-2006, 05:23 AM
thanks. and denacious, nobody has made a new thread for this.
I know I'm just making a suggestion. If you need help for one project just keep all the things you need in one thread.
Lol, denacioust's name has been hard to spell for a long time, but since my stay here, I'm used to spelling right
Well thats why I changed it to JIM
LizardRob
02-17-2006, 05:56 AM
well JIM, i get what you meant now. im going to keep looking at tose websites, havent found anything to do with games yet lol, but ill keep trying.
Flashkit has alot to do with games, let me just point you to where it is
EDIT:
http://www.flashkit.com/tutorials/Games/
woogala
02-17-2006, 05:22 PM
luiv u finished doing that thing with the .fla i sent you? It's me albigafatony but i think i got banned or something.
LizardRob
02-19-2006, 07:24 AM
thanks LuiV
i got this code from the website and put in the things i needed to but it didnt work, can you help?;
on(keyPress "") {
[instance name]._x = [instance name]._x - [speed]
}
on(keyPress "") {
[instance name]._x = [instance name]._x + [speed]
}
on(keyPress "") {
[instance name]._y = [instance name]._y - [speed]
}
on(keyPress "") {
[instance name]._y = [instance name]._y + [speed]
}
edited to
on(keyPress "w") {
Symbol 1._x = Symbol 1._x; - 5
}
on(keyPress "s") {
Symbol 1._x = Symbol 1._x; + 5
}
on(keyPress "a") {
Symbol 1._y = Symbol 1._y; - 5
}
on(keyPress "d") {
Symbol 1._y = Symbol 1._y; + 5
}
I think theres something really simple missing but this is the first movement script ive ever done, please help. thanks.
vBulletin® v3.7.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.