• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

trigg

Track and field

6 posts in this topic

Hi all I''m trying to make a game similar to track and field using flash. Please dont laugh, i''ve done the long jump using projectile motion, it took some time but works OK some small refinements. I''m currently working on the 100ms what i''m having difficulty getting a grasp of is how to decelerate the runner, accelerations is no problem. code =============================================================== HcapVal = 0.5 FPS = 30 if (Key.isDown(Key.LEFT)) { if(!lon){ // lon is activated by clicking the right key Lspeed += HcapVal lon = 1 ron = 0 } } speed = Math.round(Rspeed + Lspeed) // adds left and right values _x += speed // makes runner move on Xaxis =============================================================== i cant for the life of me get the runner to decelerate!!!! any ideas, would be gratefully accepted. Starting GCSE Physics in 3 weeks. Doh! Many thanks Trigg ============================== you can lead a horse to water but a pencil must be lead ! ============================== stan laurel ( THE BRATS)
0

Share this post


Link to post
Share on other sites
I don''t see how you''re calculating Rspeed. It seems that Lspeed is always positive, *and* always increasing whenever the left arrow is down. Is Rspeed negative? Does Lspeed ever get reduced? The only way to achieve deceleration as I see it in your code is if Lspeed gets reduced or Rspeed is negative.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
0

Share this post


Link to post
Share on other sites
HI

Flash is timeline based, you have a main timeline, which can have Movie clips at various frames within the animation, and each movie clip can have its own timeline,

how i''ve come to use Lspeed + Rspeed, its on the key press which adds the left key and right key values together. its when the user has either stopped pressing the keys therefore the runner needs to decelerate. also if the user hesitates for a period the runner also needs to slow down. this makes it a more enjoyable user experience, i think, well thats how the original game works.

If you dont know how the game works, try download Mame32 and you can then D/L track and field or hypersports.(same)

The difficulty is getting the runner to slow down.

i know the speed(Lspeed + R speed)
i know the FPS=30
i can get the distance if i need

i''ve come up with a formula.

speed = ( speed - ((speed/fps) * speed))

I check things in excel and i get a nice curve, and it takes a little longer for the runner to slow down, than by using

speed = speed/2

the formulas are put into a loop.

anywayz there you go, i''m now going to try and give it a go

Trigg out



==============================
you can lead a horse to water

but a pencil must be lead !

==============================
stan laurel ( THE BRATS)
0

Share this post


Link to post
Share on other sites
yo dude

take a ganders at

http://www.pixcel8.co.uk/longjump/longJump.html

its just in it early stages no design.



==============================
you can lead a horse to water

but a pencil must be lead !

==============================
stan laurel ( THE BRATS)
0

Share this post


Link to post
Share on other sites
I remember playing Track & Field many years ago.

I looked at your demo. I think it will be quite fun once you''ve finished it!

Unfortunately, I don''t really see how to do anything. I pressed the Play button, and the "Speed" display says "0" (makes sense). Using the up/down arrows I''m able to change the angle but I don''t see how to get the character to move or jump. The left/right arrows don''t seem to do anything at all. Perhaps you could add a small area describing controls on the screen?

In your original post, you showed this code:


if (Key.isDown(Key.LEFT)) {
if(!lon){ // lon is activated by clicking the right key
Lspeed += HcapVal
lon = 1
ron = 0
}
}

Now the way I see it, Lspeed only increases here---never gets smaller. At least you have not shown any code that causes Lspeed to reduce. This logic occurs only when the left key is pressed and the right key is NOT pressed. Makes sense.

Your speed is then calcluated by:


speed = Math.round(Rspeed + Lspeed)

You then use this value of speed directly to update _x.

I have three questions:

1) How is Rspeed calculated? Is it always positive as is Lspeed or can Rspeed be negative? Show me the formula.

2) Can Lspeed ever become smaller? Is there some code that you have not shown that is like Lspeed -= some_value? It just concerns me that maybe Lspeed is growing unbounded when you continue to press the left button.

3) Where is the code that you posted later, the code that reduces speed:
speed = ( speed - ((speed/fps) * speed)) 
? Is this something you added after your original post? Also, is your speed ever > sqrt(fps)?

I understand the timeline idea. Just still trying to get a grasp of what your code is doing so I can possibly offer some suggestions to fix the problem....

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
0

Share this post


Link to post
Share on other sites
Sorry about the confusion.

here goes then,

controls
left/right/up // just as in T&F years ago you press the right and then the left key similtaniously, Lspeed/Rspeed these get added together which is then added to move on Xaxis.

when the runner starts moving, i check the distance to see if run over board, if not OK

when user press the up key, it stops the runner where he is then makes the angle.

if the user has a .5 of a second delay in not pressing up, the this fires the projectile motion function and gets passed the speed and angle.

this then gives me a distance that the runner has jumped i then take away the distance where the runner has stopped from the board.

i then fire a variation on the projctile motion function this gives me my nice jump etc, when the runner has landed you can move onto the next jump.

I also store the jumps into array, this gets fired straight from the runner starts to run. so when you view the replay you can view any of them in any order, at first it played the lapse when the user presses the up key, i got around this by halting the population of the array until the 0.5 delay kicks in, after this i add the positions to the array etc.

at the moment the runner does not slow down, i''m just trying to get my head around a cool formula that i can apply, i could bodge it, but i want to make other events, which use the same code.

the final result stage1 will be a 1 player game, where you can store you scores, personailse the characters etc etc.

the stage2 will be multiplayer/multi spectator/ where repeat visits will award you extra powers even if you are a spectator, you can jeer and heckle even do a streak across the screen.

lots of ideas and little time to do them in.

hope that helps dude

trigg






==============================
you can lead a horse to water

but a pencil must be lead !

==============================
stan laurel ( THE BRATS)
0

Share this post


Link to post
Share on other sites
Every update frame, have the program take X off of your velocity. Every time you hit the run buttons, add Y to your velocity. That way as long as you keep hitting buttons you''ll go faster. Stop hitting buttons and you''ll start to slow down.
0

Share this post


Link to post
Share on other sites