RE: Flash Q&A thread 2 ** checked everyday (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


flsg -> RE: Flash Q&A thread 2 ** checked everyday (3/19/2006 19:04:48)

yeah I guess you're right
anyway, does someone know what does the "try{}" statement do in Java?




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (3/19/2006 19:13:45)

nope, sorry, actually thats how i learned that system for fighting, im an uber visual learner so it is easier that way from viewing the actual thing than text




somebody621 -> RE: Flash Q&A thread 2 ** checked everyday (3/19/2006 21:51:08)

flsg:For your question: Yes it should be possible. I've found a few articles on this kind of stuff: 1, 2 It's just that Java is one of the most common.




flsg -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 7:40:52)

somebody621: what question?




Darklord517 -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 12:16:28)

I am making a drag and drop game. How do i make it so that if a square i am dragging is placed directly into an empty square the movie plays frame 20?




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 14:16:14)

alright, i know this one

1)open a flash document
2)make a square and make it a movieclip named drag
3)select drag and go to the properties box and give it the instance name drag
4)in the actionscript box give it this code

quote:

onClipEvent (load) {
startX = this._x;
startY = this._y;
}
onClipEvent (mouseDown) {
if (_root.drag.hitTest(_root._xmouse, _root._ymouse)) {
_root.draggedDrag = true;
}
}
onClipEvent (enterFrame) {
if (_root.draggedDrag) {
_root.drag._x = _root._xmouse;
_root.drag._y = _root._ymouse;
}
}
onClipEvent (mouseUp) {
if (this.hitTest(_root.hit)) {
_root.draggedDrag = false;
_root.gotoAndPlay (45);
_root.drag._x = startX;
_root.drag._y = startY;
} else {
_root.drag._x = startX;
_root.drag._y = startY;
_root.draggedDrag = false;
}
}

the colors indicate what you can change red is the frame number to go to, the blue are the instances
5)make another box, make it a movie clip, and name it hit
6)give it the instance name hit




The Illusive Man -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 14:29:21)

Lil Boi. I am making a shooter. I want to have a reload scene, but i am having problems

1) Can't get an ammo counter to work

2) A reload scene just playes every 30 frames or so



Next problem. In this "Shooter" I want to have a money field.

1) Whenever you shoot the guy i want it to give you say... $100

2) Whenever you lose health, you lose $50

3) I want to be able to spend it (ingame) but i do not want it to go below zero


Hope you can help. Have worked and worked, but none of my script/variables work!

Althorne




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 14:57:46)

that looks like a job for zoltan, he's made one before, maybe the other gurrus in AS can help too,




flsg -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 17:59:59)

lil boi blue: are you sure to use hitTest?
because with movieclip, we can use _dropTarget
it's easier to use




somebody621 -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 18:05:38)

lil boi blue:try not to put as many onClipEvents, expecially onEnterFrame. Also, don't manipulate the x. Just use startDrag. When the mouse is up and the thing touching the thing you want to hit,do the drag and drop snap thing and set the x.
Althorne:Ammo counter:make a dynamic text box. Either give it a variable name as ammo, or set an instance name and put "ammocounter.text=ammo;"when you shoot. When you reload, just change the ammo to the default ammo.
For the money:make a object's money like char.money=500; and enemy1.money=500; or something like that.
Also make a function loseMoney like this:
function loseMoney(moneylost, currentmoney, attacker, shot){

Under that put this:
if(currentmoney>moneylost){
money -= moneylost;
attacker.money+=moneylost;
}else{
shot.money = 0;
attacker.money+=currentmoney;
}
}
 

When anybody gets shot, put this code:
//replace variables as needed
loseMoney(50, char.money, enemy1, char);

basicly, you just set up a user defined function. Thing of it as your new function as being like gotoAndStop, and (50, char.money, enemy1, char) as being the frame you want to go to. Buying stuff is similar to the code except you add the stuff to your inventory or something and there'd be no else. Hope this helps! I rarely give out actual code.
flsg:you posted the question somewhere.




flsg -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 18:13:16)

somebody621: lol, it's sometime useful to use a same name...[:)]
but I don't know, do you really think so?
because on the first page of the first tutorial, he used Java, it's hard to see the difference since AS 2.0 added try{}, catch{} and finally{} too

the second tutorial talks about Flash Remoting, and I'm not sure what it is(I already heard about this)




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 18:23:42)

do not question my authoratah! *whips flsg and somebody* back...back to your desks, learn more actionscript codes! lol jk, i dont know most of the stuff you guys talk about when it comes to AS, i just present it in an easy way, i have a knack when it comes to explaining or as people say, thats why i dont put a lot of stuff of the AS you guys post because i take it, if i get it, i'll post it up, pretend you're explaining things to kindergarteners so that its a step by step instruction (for all we know they could be here lol) but like when you say dont use hittests, in my mind i dont know what else there is, or for that matter ANY comments you make on my code i don't know what to change, i just see how i did it from unhosted games that i've made and copy/paste codes onto here saying "put onto drag"




flsg -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 18:33:11)

lol sorry LLB, you're a better teacher than me, I don't explain enough[>:]
next time, I'll try to explain more
if I'm too lazy, then you could check in the AS help file in Flash:

open a Flash file, in any frame, open the AS window
type _droptarget
select it
use the dictionary button, then you'll see the _droptarget help's file




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (3/20/2006 18:57:12)

i typically say this but please dont use[>:],[:@],[:'(], unless you mean it, if you did mean it i didn't necessarily say were a bad teacher, i just said that I felt that i was a good teacher so sorry if i offended you, im typically a jokey kind of guy (and everyone always has questions about AS anyways so lol...l...o...l)




Darklord517 -> RE: Flash Q&A thread 2 ** checked everyday (3/22/2006 3:21:47)

Can someone help ive made this beginning to an RPG and now im trying to play a battle. When you get to the end of the scene with the shop and house at the end of the road should be a little wall. When you hit it you should be transported to scene 2 for the battle. Im not sure how to do that, please help.

The game is here:
http://img69.imageshack.us/my.php?image=rpg8ev.swf




somebody621 -> RE: Flash Q&A thread 2 ** checked everyday (3/22/2006 17:39:33)

Woah. First things first. Get the page turning right.When you reach the end of a scene and go to the next one, your character should be next to the road on the other side, not already on the end of the road. Also, do not use music for demos. It takes too long to load.

Now for the actual thing. Do not actually use scenes unless the game is a ton of frames. Just use battle frames. If you really need scenes, use gotoAndStop(scene, frame);




flsg -> RE: Flash Q&A thread 2 ** checked everyday (3/22/2006 18:47:32)

I agree with somebody!!!
if you have over 100 maps, what will you do?(Almost every online RPG has more than 100 maps)
then you'll need 100 scenes lol




Darklord517 -> RE: Flash Q&A thread 2 ** checked everyday (3/23/2006 1:49:43)

How would i make it so that the ball starts at the beginning of the road not at the end?




flsg -> RE: Flash Q&A thread 2 ** checked everyday (3/23/2006 16:42:37)

darklord: your code isn't very effective, but here's what you could do:
in the map where the player is at the end, put this on the _root:
player._x=number
player._y=number

player is the MC's name, and number is the number(lol)
if it's on a MC, just simply add a onClipEvent handler on this code




somebody621 -> RE: Flash Q&A thread 2 ** checked everyday (3/23/2006 17:27:59)

I would just use a function to change maps(see the code a couple lines above)




flsg -> RE: Flash Q&A thread 2 ** checked everyday (3/23/2006 17:44:53)

hey guys, I just got a VERY weird battle system idea(only for 3v3):
why not put peoples in an Array?
set a variable, wichPlayer=0, we'll use it later.
use an loop to check if place(place is the position of the char,ex:the second of the left is 1(start with 0)) is empty. if it is, then do nothing, if it's not, then use Array.push() to put the player in an Array, PlayersPos.
during the battle, we check if the player has finished his attack, if it's true, then wichPlayer++(if wichPlayer<PlayerPos.lengh, else wichPlayer=0), and invoke: PlayerPos[wichPlayer].attack()
if the player die, then we'll delete it from PlayersPos(forgot how, but I'll find a way later)

what do you think?[:)]
the advantage of this is we don't need to check eveytime if a player die, or if a place is empty
other then that...I don't know lol




somebody621 -> RE: Flash Q&A thread 2 ** checked everyday (3/23/2006 19:27:47)

flsg:nice idea ; ) Also easy just and efficient doing battles.

I've started playing with my fire again. This time, however, it's a speed test to see how fast certain types of graphics are drawn in flash. I've also added wind. Here it is!
Looking at this, I don't think that bitmaps make a huge difference in flash drawing.




lil boi blue -> RE: Flash Q&A thread 2 ** checked everyday (3/23/2006 19:35:45)

lol, sorry flsg but is there a way to make a 1,2,3,4,5, etc... learning tutorial for your AS, because i don't understand when i read it myself, i find it easier just to give the codes to people and then over time they learn what everything means instead of explain along the way, maybe at the end of the post just say for like
code: on(press){gotoAndPlay(2);}
code translation: under the condition of pressing this button, go to and run frame 2 but only under that condition




flsg -> RE: Flash Q&A thread 2 ** checked everyday (3/23/2006 19:51:02)

LBB: I don't understand what you mean...
what's 1,2,3,4,5... that you're talking about?




somebody621 -> RE: Flash Q&A thread 2 ** checked everyday (3/23/2006 19:54:11)

He means something like this, I think:
1. show code and explain it
2. show code and explain it
etc.




Page: <<   < prev  3 4 [5] 6 7   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.15625