View Full Version : Hacky Sack game.
SlrRanma
08-17-2004, 02:19 AM
Hi i'm new here and this is my first post and i'm not sure if this is the right place to post this but it seems pretty simple. I'm making a hacky sack game for a class project and i was wondering if anyone can help me out and tell me some kind of script that will allow me to have an object like a ball be clicked then be hit into the air again. That way you could click it again. The object of my game will see how long you can keep it up in the air. if this is in the wrong place then sorry. Any help would help thanks!!
OH yea if you really dont understand what kind of game i'm trying to make here is a game similar to what i want to do. any help pleasee! thanks again
Super Kick Ups (http://www.spikything.plus.com/games/kickups/)
Jetbbal
08-17-2004, 10:59 PM
not sure how to do all that but check out the gravity tutorial at http://www.bit-101.com/tutorials/
might help :D
Dr Warm
08-18-2004, 09:17 AM
yeah if you follow the tutorial then just times the yspeed by -1 on(release) or on(rollOver) and that should be fairly decent, but if you want it so the ball changes angle depending on where you click on it its a bit harder, you'd need to look at the detect mouse angle II in the tutorials
SlrRanma
08-18-2004, 08:17 PM
ohh cool i'll check those out and see what i can do with them. If you guys have any other tips or tricks let me know. thanks again!
curryjon51
08-19-2004, 05:03 PM
Hi
Could probably be done a lot better, but it works.
hth
SlrRanma
08-19-2004, 06:48 PM
Ohh wow. it's better then my game lol. I'm going to study your code and see if i can get mine to work like yours. Thanks alot!!
SlrRanma
08-21-2004, 03:21 AM
Ok so i got my game to work like yours curryjon51 but this might be a dumb question. But how do you put a background pictures in it? Thanks alot!!!
curryjon51
08-21-2004, 05:02 AM
Hi
For the ball, because it is attached, you can just replace the (crud) graphic I used with something nice downloaded off the net.
For the background, where I drew a yellow square with as, into an empty mc, you could load an external swf into it, therby replacing it. Or, you could remove the createemptymc code and replace it with either a graphic placed directly on the stage, or with an attached mc from the library... in the latter case, you would replace the createEmptyMc code with attachMovie code
Depends what you want really
hth
SlrRanma
08-24-2004, 06:32 PM
so would i get rid of all of this:
this.createEmptyMovieClip("bg", dpf+100);
this.bg.lineStyle(2, 0xFF0000);
this.bg.beginFill(0xFF0000);
this.bg.lineTo(R, 0);
this.bg.lineTo(R, B);
this.bg.lineTo(0, B);
this.bg.lineTo(0, 0);
this.bg.endFill();
Then drag a background to the stage?
curryjon51
08-25-2004, 01:00 AM
Hi
I think that would work. And, in case it doesnot: this is a version with the background set using attachMovie... you can just replace the gfx of the bg in the library with something you like.
hth
SlrRanma
08-25-2004, 01:36 AM
Yea i tired deleting the above code and draging a bg into the stage but it did'nt work. and then I downloaded your version with the background and i replaced it with a background of my own but now it's not centered and it's does'nt seem to fit the game. Just to let you know we are making a game that is 640 by 480. Maybe that will have something to do with it
curryjon51
08-25-2004, 06:29 PM
Hi
Yes, the background gfx you place in the library should be at _x=0,_y=0.
Then edit the code in the fla to read: R = 640 and B = 480 the game should then automatically resize to those dimensions.
hth
SlrRanma
08-27-2004, 06:22 AM
so i got it replacing the ball and the background. I want to be able to have the player choose what hacky sack they want to use and what background they want. i dont know how to edit this code:
this.attachMovie("BG", "bg", dpf+100)
I try to make my own background but it seems to be connected some how to background. Like when i replace the "BG" and the "bg" with some other movie it still goes to the BG. I dont know how to change it or anything like that any help will do thanks!
Dr Warm
08-27-2004, 10:15 AM
If u right click any item in the library, the go to properties, you can select export for actionscript and then choose a name, this means you can use the attachMovie method, i think this is what u mean
curryjon51
08-28-2004, 12:44 AM
Hi
Dr Warm is correct the background is attached using the linkage name in the library. Probably the easiest way, if you are wanting more than one background, would be to have a bg-movie-clip with a stop action and a differnet picture on each frame. Then, if you wanted to change your background you could just have a button send the bg-movie-clip to the correct frame with a gotoAndStop().
Hth
A Creative Edge
06-21-2005, 04:45 PM
Hi,
I am also trying to make a Hacky Sack game like http://www.spikything.com/games/kickups/. I have followed the gravity tutorial http://www.bit-101.com/tutorials/gravity.html which only lets you pick up the ball and throw it. Does anyone have any ideas on how the ball could be hit to do kickups? I also need to develop some sort of scoring system. Any ideas anyone - I would be really grateful!
Thanks for your help,
Andy
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.