PDA

View Full Version : My New Project Need Advice On



Floby
23-08-2006, 05:12 AM
Hey Im New To Pascal Just Started it In School and yea i have an idea but im not sure on the structure i have a basic layout but its a bit crazy:P
im not that gud yet but ok enogh about me heres my a idea

a game where some one can juggle virtualy and learn the motions im not sure fully if im going to have a changing accelration to gravitiy to help simulate the effect of how 3 or 4 ball juggling works but im new and need advice plz help :P thnx

JSoftware
23-08-2006, 05:59 AM
simulating forces on rigid bodies like juggling balls would be pretty easy. The hard part that I can't realize is how you would make the user juggle with a keyboard and a mouse? :shock:

Floby
23-08-2006, 08:11 AM
Owwww My Bad i Forgot to Mention Not Using a Mouse lol remember im the noob :P but im still a bit unsure on my structure i have a few ways i can do it but im not really sure you no

tanffn
23-08-2006, 08:31 AM
Using the webcam you can grab the user image and render it in the screen + the balls. Monitor his movement and allowing him to control the ‘fake’ objects (i.e balls).
It can be fun to write.. :)

savage
23-08-2006, 08:52 AM
This is essentially the way that the EyeToy works. It compares each frame to the previous frame to determine what has moved and can then use that to create some collision boundaries.

tanffn
23-08-2006, 12:40 PM
I was thinking to take an image of the empty room, make the delta with the new image (with a person) run an edge detection filter (to know the boundary). very basic.. no need to find the eyes, or relative size (to try and interpolate 3D from 2D, ball getting bigger or smaller)

Floby
24-08-2006, 02:28 AM
yea these are all good ideas but if we refer back to the top "im New to Pascal" and all can i get some links to maybe source code or syntax help in some way would be Great :P Thnx

WILL
24-08-2006, 03:07 AM
Hmm... well leaving alone the super-highly technical physics engines that NASA could use to launch, orbit and send their rokets into other galaxies...

I'd suggest simple physics for the balls to be lobbed into the air and gravity to pull them back down.

One of Many Possible Methods I'm Suggesting:

Then have 2 platforms (aka game hands) that can move side to side within a limited range on each half of the screen. (left hand for left side, right hand for right side only) Now to successfully keep the balls in the air you have to 'bump' them back up with your hands. The object will go back up in the air and (hopefully) over towards the other hands side.

You can use random values for how much the balls speed will travel the other way AND/OR have it influenced by at what point the ball and the hand 'connected' while the hand was performing it's 'bump'. ie. measure the height at which the collision happened with the hand and make a speed calculation based on that height from the normal setting hand possition. This will make it so that the same code to 'bounce' the ball back up can be used to make the ball tap off the hand and fall on the ground too.

You could give the player a score based on each time a ball is touched by a hand you get a point value. Add more balls that value goes up or the heavier the ball/object (people can juggle more than just balls!) the more points. Of course the weight of the object will influence the speed and height that it will travel, etc, etc... so it's your choice how complex you'll want it.

Hope this helps. Or at least give you enough to go on that you can come up with your ideas. This is how I would try to do it if I wanted to keep the code simple.

Oh, and Welcome to PGD! ;)

WILL
24-08-2006, 03:16 AM
Oh, I forgot game controls... :P

Of course not using a mouse this isn't too hard. (You'd probably need 2 mice anyhow ;)) You just need two (what I call) arrow 'T's. You must have played at least one game where you had to use the arrow keys to move up, down, left and right... well the keys form in an upside down T right? Same same with the wasd combo... well make two of 'em! :) wasd and ijkl OR whatever else you feel will be most comfortable for the player.

You'll only need the LEFT, DOWN and RIGHT keys on each though... DOWN will be the 'bump' control.

Should make for an interesting test of hand-eye co-ordination. Anyone else know of a game like this?

fauvem
24-08-2006, 04:04 AM
The nearest thing I've seen to that is something made by a friend, what he did was 3d pong except that you controlled both ends & the paddles were curved while the whole thing rotated to random angles during the game. You gained points for every successive hit from the second paddle & most points win.

Floby
24-08-2006, 08:07 AM
Thnx Alot i have a Basis of the Equations i need for the way it bounces but im not sure on how to get the bump effect u aim at i like it alot i had the idea of when it hit between a line of the pads and have been experementing its palcement with x and v (x Axis and V Velolcity) and am not sure how to get it and when i added a Roof to the game then things got intresting lol i had the ball hitting and going back up and floating into a Cubic motion and was like What the hell :P so yea here are the equations im using
t := t + 1 * way;
x := x + (30) * Way;
v := v + a * t;
d := v * t;
y := y + d;

v := 1; t := 0; d := 0;
way := 1; backup := false;
y := 50; x := 450;

i have it when it hits a certain point backup = true and v = -v and way =-way and yea u get the idea but iv experamented with the so called bump effect yet the bounce parabola motion gets faster and thiner and when i incress x it bounces wider yet alot faster.

WILL
24-08-2006, 08:19 AM
No problem at all. :)


im not sure on how to get the bump effect u aim at

Just have the hand raise up a bit (give it a few 'frames' to do this gradually) and make it a 'bumper' that increases in power when it's above the setting height. You could make it a more skilled(timming) based type of gameplay where instead of it being the higher the hand is the more powerful is BUT INSTEAD having the lower it is the more powerful it is. It'll make it more rewarding for the juggler to be accurate in his timming. A better rethrow of the object if he hits it just at the right time than if he hit it too long before and it's a sloppier toss up and he has to recover the ball into a nicer throw pattern or it starts to become harder to juggle as the balls get more and more 'out of control'.

So collision detection will detect a connection between the hand(bumper) and the ball and the ball will react with the bump reaction to the contact wit hthe hand (make up a set of 'rules of the hands' function that will change the ball to do what you want and run the ball through it when it touches a hand)

Give it some thought. I think you've got it from here. ;)

Floby
24-08-2006, 08:41 AM
Lol Yea I See That Makes Alot of Sense Thnx Alot Even Tho Your Reference to Incress Power Means incress Velocity and iv been expermenting with that and its been umm somewhat intresting :P but yea ill work it out thnx u have beeen alot of help.

IlovePascal
11-12-2006, 05:10 AM
I think you should give up on this floby dude!
Why dont you get into something simpler...?
...like tank invaders...! :lol:

lol enjoy ur holidays!

Chesso
08-01-2007, 02:40 AM
If you do a bit of google searching, you'll find a flash game like this, it's very basic (as in no levels or real objectives aside from score) but it might give you a good idea.

Sorry I can't remember the name but it's really... really... wack to say the least.