Need Programming Help

Subscribe to Need Programming Help 10 posts, 6 voices

Sign in to reply


 
avatar for Guy_In_Armor Guy_In_Armor 1140 posts
Flag Post

I’ve decided to try and take part in the Endurance challenge. I have very limited experience with coding, though I hope that Kongregate will be kind enough to help a poor lil’ noobie Developer out. So far, here is my current ‘story’ for the game…



November 7, 2009
You are a superhuman created to protect the city in case of an event that the city can’t handle. And that event happens now…

A bomb is launched directly at the city, a really really big bomb, and you are awakened to take care of the problem.

You stop the bomb from hitting, but you still need to get rid of it…. so you run.

You run, and run, and run. The further away from the city you get before the bomb goes off the better.

There are obstacles, such as ledges or corridors, or smaller corridors. The bomb is too big to fit into the corridors, and must be thrown at the right time to go above it so when you come out on the other side you can grab it.
The smaller corridors are just that, but you must also slide under them because you are too tall to just walk under the ceiling.

The background would start as a city, then go into more of a suburben area, then grassy, to forest, to the desert, as you go further and further away from the city.



Now here are my ideas for the player.

You have pretty high health, and can endure a good bit of damage. Going through, under, and above obstacles takes

effort and can be done wrong. Every time to miss manuvering an obstacle you lose health depending on the severity of the miss. And if you get a ‘Perfect Dodge’ you build up points which can activate a Jetpack ability which allows you to fly over obstacles while holding the bomb, and sometimes you can find Health powerups while in the air or on top of something like a corridor, which replenish health. Though if you use your jetpack for too long you can risk detonating the bomb.

Your bomb, on the other hand, has very very low durability, and won’t stand much. Powerups can be found to increase the durability of the bomb, which will add 1 More Hit every time, with a maximum of 8 hits resisted in total.
Default health is 1 hit for the bomb.
I, Guy In Armor of Kongregate, take full credit for this game idea. Please do not use my idea without asking.

This game is kind of like Canabalt, yes. That’s the game type I’m going for.

I would like help with programming and coding, and possibly anyone’s ideas on how things would look or work. This game idea is still taking in plenty of ideas, so share what you’d like to see added, and I’ll see what I can do.

Now, what I really need is this.
I use AS2, first of all.
•Making health work, and having it work separately for player and bomb.
•Making the throwing of the bomb work, and then grabbing it to get it back
•Jetpack and Combo Points for Perfect Runs
•Health Replenishes and Durability Increasing ‘powerups’ work

I know it sounds like pretty much the entire game, but like I said I am a noobie when it comes to coding and AS, but I don’t want someone else to make the game’s coding for me because doing it myself will be a good learning opportunity.

Thanks for the help, Kong.
-GIA

 
avatar for SuperMarioJump SuperMarioJump 223 posts
Flag Post

This is all pretty much covered in the shootorials. In fact, you can start off with the shoot game and change the ship to your hero (make sure he can’t move up/down), change the enemies to obsticles and change shooting to throwing a bomb up in the air. Job done.

 
avatar for zero579911 zero579911 345 posts
Flag Post

Well pretty much ur just asking us to build the game’s engine for u.

As SuperMarioJump said, start with the shootorials.

 
avatar for Kaapola Kaapola 37 posts
Flag Post

actually, I think theres one thing he needs and the shootorials dont explain… gravity. Not sure tho, Ive only went through them once.

 
avatar for Guy_In_Armor Guy_In_Armor 1140 posts
Flag Post
Originally posted by zero579911:

Well pretty much ur just asking us to build the game’s engine for u.

As SuperMarioJump said, start with the shootorials.

No, I’m asking for coding tips.

I’m new to AS and only know the very basics, and some other bits. The Shootorials don’t tell me how to make the physics of throwing the bomb up, and then having it come back down so you can catch it ect.

 
avatar for SuperMarioJump SuperMarioJump 223 posts
Flag Post

At it’s most basic, you’ll give your bomb an initial upwards velocity. When the throw button is pressed you start every frame decreasing the bombs y value by the velocity, then decreasing the velocity by a gravity constant.

 
avatar for Kaapola Kaapola 37 posts
Flag Post

btw isnt the jetpack and throwing the bomb the exact same thing what comes to coding it?

 
avatar for BillysGames BillysGames 25 posts
Flag Post
Originally posted by Kaapola:

btw isnt the jetpack and throwing the bomb the exact same thing what comes to coding it?

Well, kind of. In terms of an object’s influence under gravity, sure.

 
avatar for zero579911 zero579911 345 posts
Flag Post

gravity is easy to do.

Just use a constant pull. So like _y += gravity;

 
avatar for KMAE KMAE 116 posts
Flag Post

F=ma

fBomb = massOfBomb * accelerationOfBomb (no… not that type of fbomb :P)

*If player has bomb and presses button
*Bomb gets thrown up
*Bomb goes up and comes down
*If bomb comes back with positive hitTest on player, player catches bomb (if bomb hits something else subtract life)

You need the bomb goes up and comes down part.

fUp – fBomb = fDirection

fThrow you can pretty much play around with to get a good value. You’ll probably want the direction of throw at 45 degrees since you will be running, sort of like catching a football unless you want to make catching it more difficult.

the angle will split up the fThrow to go horizontal some and vertical some. Sorry if this is all too basic.

I think you are interested in just the part that goes up right now.
fUp = fThrow * sin(45) (you’ll have to convert this to radians as sin uses radians in AS)

you can check if fDirection is positive or negative to tell in which direction you are going. Remember positive will be -y and negative will be +y since the coords on the stage are upside down.

subtract fBomb from fUp for each iteration and you should get a nice parabola.

Sign in to reply


Click Here