-
Reseting - after code is play
Okay I have this ball i throw it hits a basket.
I make the ball invisible and a movie starts playing like the ball is going in the basket when the movie is done I have a code to make the actual ball visible again in a particular location of the stage....
and then is when I have issues ... I need the ball to be reset so I can shot it again.and remember all i need is for all the variables to cear to the original stage so i can shoot the ball again.
Thanks in Advance
Part 1 of 2
here is the code for the ball .... getting send to the basket ...
var Ball_x = Ball._x;
var Ball_y = Ball._y;
var Box_x = Box._x;
var Box_y = Box._y;
var speed = 50;
var time = .8;
var rate = 1/(speed*time);
var amt = 0-rate;
var Ball_Position = false;
var shootin = false;
Ball.onPress = function() {
Ball_Position = (Ball_y>Box_y) ? true : false;
The_Object.Mover();
};
The_Object = new Object();
function delayChk(iS) {
clearInterval(The_Object.intID);
The_Object.intID = setInterval(The_Object, iS, speed);
updateAfterEvent();
}
The_Object.Mover = function() {
if (Ball_Position) {
Ball._x += speed/7;
Ball._y -= speed/5;
Ball_Position = (Ball._y>Box_y) ? true : false;
Ball_x = Ball._x;
Ball_y = Ball._y;
} else if (Ball._x == Box_x && Ball._y<Box_y) {
Ball._y += speed /3;
Ball_x = Ball._x;
Ball_y = Ball._y;
} else {
amt += rate;
Ball._x = Ball_x+(Box_x-Ball_x)*amt;
Ball._y = Ball_y-Box_y/2.2 *Math.sin(Math.PI*amt);
}
if (Math.abs(Ball._x-Box_x)<4 && Math.abs(Ball._y-Box_y)<4) {
Ball._x = Box_x;
Ball._y = Box_y;
clearInterval(this.intID);
} else {
delayChk("Mover");
if (Ball.hitTest(Box) and shootin == false){
shootin = true;
_root.basket.gotoAndPlay(2);
}
if (shootin == true){
_root.Ball._visible = 0;
}
}
};
part 2 of 2
and here is the code in which i send the ball back to the original spot....when the movie clip is done...
_root.Ball._x = 186;
_root.Ball._y = 242;
_root.Ball._visible = 100;
_root.Ball_Position = false;
_root.shootin = false;
gotoAndPlay(1);
Jay
The man with the plan !!!
-
Hype over content...
Jay, can I just ask, what part of this game have you actually done ?
This must be about your 10th thread about throwing a ball into a basket. No offence, but if you're going to do a basket ball game, didn't you think before hand that you don't actually know how to do it ??
I don't know how to do a physics based game, so I don't think "I'm going to code Trucks II".
So you've had the ball throwing code provided for you, and you've actually got the code to re-position the ball. Is it too much of a stretch ( Remember, you are actually coding a game, not doing a stickman animation, so you've got to be able to code to at least a certain standard ) to put those lines of code into a function, and then when the ball has done it's thing, call that function ?
The board is all about helping people mate, but you've got to at least show you are trying ( It's pretty clear you've not even read the Read Me First sticky, try using the [ as] ( Or [ code ] ) tags, makes things a lot easier to read ).
Squize.
-
DUDE I got code after code you are right but also I fix alot of this code to work the way is supouse to and i have done alot more code that you are not seeing here and that is because i do not want some one to steal my idea.
I know i can creat a switch on and on with a true false statement but for what ever reason it won't work so i come here to ask.
So in my eyes you being unapropiate this is a totaly diferent strugle and i beliebe this is what the forum is for if you do not want to help then cool don't but there has been a lot of cool people here very helpfull and that is why i come back not to mention i have solve a lot of people issues along the way.
Jay
The man with the plan !!!
-
Flash Incompetent
maybe Squize is saying you should start with a project you feel more comfortable with and try to expand on it and learn that way rather than tackle a project over your head?
I personally wanted to make an RPG extremely badly; however, I know my actionscript is not up to par to create a solid RPG, I could probably pull off a crappy one, but instead I am creating a simple shooter and polishing it to the best of my ability, learning a lot of actionscript along the way... maybe once I have really finished this project off I will feel more comfortable creating an RPG style game and have it come out decent.
Last edited by ChaseNYC; 07-13-2006 at 01:22 PM.
mmm signature
-
Hype over content...
"i have done alot more code that you are not seeing here and that is because i do not want some one to steal my idea."
Cool. Guessing the ball movement was still the trickiest part of the game though. Also the core of the game, ie without it, it's not a game anymore, just a front-end.
"So in my eyes you being unapropiate this is a totaly diferent strugle and i beliebe this is what the forum is for"
Yep, the whole community is here to help out. Just wears a bit thin one person asking for help for every stage in a games development.
Let's turn on it's head then. What have you tried to reset the ball ? What steps have you gone through to get it working ? What values did you trace out ?
ChaseNYC, you've pretty much got it mate. It's not so much people aiming too high, as people using the board ( And in effect people's good will and time and knowledge ) to get there using the min. of effort.
Squize.
-
I get that but I am coftable with my skills all you need is a second set of eyes to help that is all I am asking ...just look and see if you can help.
Is like i knew when i started the project how to acomplish 75% of it and i knew i need it to understand a little more i got some books and some good people to help, my questions got repeated because people didn't know what i was actualy asking when i solve that issue I go my awnsers I fix my mistakes.
Now I am at another level and how i know to do it is not working i can get that knowledge from books is only by trial error and poeple like the ones on this forum the good ones at least... So i do not know why he has to be rude about people asking and i see that more and more hey if you do not know cool let some else awnser because there will be another mate that will apreciate that awnser.
BTW if it was for me i will be working on a RTS biut I am trying to do something fun and cool and hopefully get a group of people to join to make this game one for the ages
Jay
The man with the plan !!!
-
Let's turn on it's head then. What have you tried to reset the ball ? What steps have you gone through to get it working ? What values did you trace out ?
in a nicer way you could just say have you seen values you trace out
that was It eb cool enjoy have a nice day hey how is it comming when can i see it anything just don't try to step on people because you are a flash god.
Just be cool people ask about how to make a score board are they not deserving of asking.... may be some people do it different ways so what I still want to see just like that ball that Arcs I did it with objects and some help I made the code and some one fix somethings then i fix the other things. I didn't want gravity and distance i wanted to created with objects
and if you look at the history you will see that the original idea came from me and that i wrote at least 60% of this code.
Jay
The man with the plan !!!
-
Script kiddie
Sorry, Jay, but I'm gonna have to crush that dream of yours: RTS'es require an unbelieveable amount of work. Even my RTS which didn't even have buildings, or any kind of unpassable obstacle on the battlefield, had over 10,000 lines of code in it, and took me half a year to make, with nearly five years of experience writing games in Flash. You're having trouble with a mere basketball game. RTS'es are at nearly the top of the difficulty heirarchy in Flash, with GTA remakes, RPGs and multiplayer games being high up the list, too.
-
And that is cool RTS is a dream for right now but i and not doing the typical basketball games they make on flash i want to make sure i take the code to the max.
I have goten ideas from other games and BTW i do have an idea on how to make and RTS game but you need people to come toghether for that and i believe i can find pasionate people that take pride onthe work, some here said onece make a good game not a lot of bad ones. I know i can acomplish i may have to use a different language but I will one day not today but one day.
and the forum is for people to come toghether BTW, if I am wrong then I am in the wrong place
Jay
The man with the plan !!!
-
Senior Member
Originally Posted by Jay2391
you are not seeing here and that is because i do not want some one to steal my idea.
No one's going to want to steal some newbie's half-working "idea". You based it on basketball. Everyone knows basketball.
So post a link to your game so we can at least SEE what's going on. Scanning through snippets of code is not enough.
-
Patron Saint of Beatings
Tons of people come here with ideas, and one of them called us Dreamcrushers (which is STILL a game I have to program...).
The basic thing you must realize, is it's not like most people here are trying to be mean by saying that such and such a game probably is not going to get done. A lot of people have been on this board for years, and have seen time and time again, someone wanting to make the next MMORPG, RTS, GTA, RPG, Zelda, Drag Racing game. But years laters, Nothing, Zipp, Nada...I know quite a few people who quit Flash altogether because they couldn't make their big SPRG game.
And so, people are being nice when they say it probably can't be done. They want to save you the fustration of:
Too much work + No profit + Not really great friends = Nothing^2 usually.
-
Script kiddie
Originally Posted by Jay2391
And that is cool RTS is a dream for right now but i and not doing the typical basketball games they make on flash i want to make sure i take the code to the max.
I have goten ideas from other games and BTW i do have an idea on how to make and RTS game but you need people to come toghether for that and i believe i can find pasionate people that take pride onthe work, some here said onece make a good game not a lot of bad ones. I know i can acomplish i may have to use a different language but I will one day not today but one day.
and the forum is for people to come toghether BTW, if I am wrong then I am in the wrong place
Looks like you're relying on other people to help you out with this; instead of dreaming about working on this as a team with people who share your dream, develop the skills to cover every aspect of it yourself. Collaborating on big, unpaid projects only works with very good, skillful friends.
-
i want to make sure i take the code to the max.
I'm sure you meant let other people take their code to the max for you?
-
Originally Posted by Fall_X
I'm sure you meant let other people take their code to the max for you?
I guest you are he genius here that nows everything and if you seem all the work i have donealready you will not be such of morron
Jay
The man with the plan !!!
-
Patron Saint of Beatings
I guessyou are the genius here that knows everything and if you seen all the work i have done already you know I'm a moron
Fixed.
Okay seriously. I just went through a bunch of old posts of yours. Please show some of your work. Anything?
Admittedly, so far, no one has been calling you a "moron" per se, and we have only once asked to see the mythical basketball game, but if you're so good, and we will all be "morron" because of it. Well then go ahead and show something. ANYTHING!
-
look dude like I said before I want my work to be at least be 75% before I put it on the site I am creating and I do not belive that i should shared my work until I feel conftable but all I can say is that I am happy where I am at.
So all mighty Jackson and all masterfull coders that know better han anyone like I put on my other post ...
I am at peace I got my awnser already and i will have more questionI just should be carefull about how i go about it.
Guys is cool you win you are the experts and we are the morons.
Jay
The man with the plan !!!
-
Patron Saint of Beatings
Originally Posted by Jay2391
look dude like I said before I want my work to be at least be 75% before I put it on the site I am creating and I do not belive that i should shared my work until I feel conftable but all I can say is that I am happy where I am at.
So all mighty Jackson and all masterfull coders that know better han anyone like I put on my other post ...
Naw, I'm just the guy smart enough to use the search feature to find information. It is one of the reasons I went from a n00b to actually knowing Flash pretty okay. (NOTICE THE WORD GOD OR EXPERT ARE NOT USED IN THIS STATEMENT. CHECK OUT EVERYONE ELSE. NO ONE SAID THAT AT ALL...)
Same thing with Google searching...
What is so special about this game, ESPECIALLY SINCE IT IS NOT WORKING RIGHT, which makes it so you can put anything online to show?
So far, people have been blindly giving you line after line of code. Some people have even given you full FLA files. Right now, since you're still having issues, it might be because the code which is being combined together doesn't work well.
You can only blind guess helping people for so long.
And you don't even have to give out the FLA, just publish the SWF and show where the problem is.
-
you are exacly what si wrong with being smart they like to be a brat ...
I wanted a question awnser either doit or don't don't make ingnorant coments
at this point I see the same dudes that are always here just saying hey we are to smart to awnser some type of questions ++++ if you read what i said before....
sometimes you read read and lisent and you need to find tht one person that understands what you confusion is so you can get the proper help does that mean we ask question in diferent way yes ....am i trying to bother anyone..NO.. I ask and hope that i get my awnser... but I do not going to be lecture by someone that dosen't know my work.
so I am cool what you said is just ignorant to my argument
Jay
The man with the plan !!!
-
Patron Saint of Beatings
I asked you some questions to help you in the last post.
So do you don't want help then?
Last edited by WilloughbyJackson; 07-13-2006 at 10:29 PM.
-
Senior Member
This thread is not going anywhere so I am closing it. Jay2391, respect other members, calling people morons is not going to get anyone help you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|