• Home
tudwaythecore.com
blog
  • Recent Posts

    • Detecting focus in flash player
    • BitmapData PerlinNoise
    • Creating bridges in APE part 2
    • Creating bridges in APE
    • SteerWheels 2
    • Creating a simple APE example
    • Design me some levels!
    • Finished Migrating
  • Recent Comments

    • tudway on Creating a simple APE example
    • tudway on creating a platform game in as3 part 4
    • venu on Making a Shooting Game in AS3
    • chris on creating a platform game in as3 part 4
    • Kronoshifter on Creating a simple APE example
  • Categories

    • APE
    • flash
    • game
    • platform
    • sound
    • tutorial
    • Uncategorized
  • Archives

    • May 2009
    • October 2008
    • September 2008
    • August 2008
    • May 2008
    • April 2008
    • March 2008
  •  

    September 2010
    M T W T F S S
    « May    
     12345
    6789101112
    13141516171819
    20212223242526
    27282930  
  • games

    • Game Showcase
May 19

SteerWheels

flash, game 2 Comments »

Here is my new game SteerWheels!
You can play it here
It is a fun, interesting physics based game where you have to push the ball to the bar using the car (controlled by the arrow keys).

I created it back in february, but i acquired sponsorship for this game so me and my sponsor, GamesReloaded.com, spent the rest of the time tweaking it so that it was as perfect as could be managed.
It was made using CS3 (obviously) and APE, which is an open source flash physics engine. which is free and really easy to pick up. I will make a tutorial on the basics later.
This was also an experiment to see if i could make some money on a flash game. i have deduced that you can make anything from a really small amount to a massive sum.
One last thing for you to look at.
SteerWheels Stats!
These are the mochibot stats for SteerWheels and they are updated daily, so you can see how many websites and views the game has got. Even though it says the game has been out for 90 odd days, it has actually only been out for 7 days, So these stats are quite impressive (i think).
Feel free to comment!
Mar 29

creating a platform game in as3 part 5

flash, game, platform, tutorial 17 Comments »

Welcome back, At the end of the last tutorial i wondered what would happen if we had a platform that you could jump underneath from.

As you can see, i have made the map a lot more complicated, and the simulation runs quite accurately until you go under the overhang on the left side. Where you can jump through the bottom of that platform. Lets change that.
We need to add a hit detection for when the top of the character hits the bottom of the land.
Ok, now you can’t jump up through platform bottoms, but if you jump sideways into the hovering platform, you float down.
I will think on this matter for the next step in the tutorial.
Mar 28

creating a platform game in as3 part 4

flash, game, platform, tutorial 4 Comments »

In the end of the last post we had a problem where the character vibrated. This was because when ever the character touched the floor i made it move up by one pixel. to rectify this i will make another hittest that detects when the character is one pixel off the floor and only calculate the velocity of the player if it returns false.

Some code:-
PLAIN TEXT
Actionscript:
  1. <span style="color: #666666;">function run(event:Event) {</span></div>
  2. <div><span style="color: #666666;"> velocity+=gravity;
  3. if (land.hitTestPoint(char.x, char.y+char.height/2, true)) {
  4. velocity = 0;
  5. char.y--
  6. }
  7. if (!land.hitTestPoint(char.x, char.y+char.height/2+1, true)) {
  8. char.y += velocity;
  9. } else {
  10. velocity=0;
  11. if (attemptJump==true) {
  12. char.y--;
  13. velocity =-5;
  14. }
  15. }
  16. if (goleft==true) {
  17. char.x+=lspeed;
  18. }
  19. if (goright==true) {
  20. char.x+=rspeed;
  21. }
  22. }

This is only the new run function because that's all i have changed.
I have removed the else statement that i created last time to calculate the velocity and moved it to the new hitTest where i calculate if the character hits one pixel above the land.
The other thing that i have changed is to move the attemptjump function to the new hitTest and add to it another char.y-- which means that the character will be able to jump with the new hitTest in place.
Heres a demo.
Ok thats that problem fixed. Now i have noticed that when you walk into a steep wall, you seem to go into it for a bit and then float to the top if you stop. To fix this we can make it so that you can't walk up steep hills. We can do this 2 ways, either by creating 2 more  movieClips, 1 either side of the character and calculating the gradient in between them. Or we can use the hitTestPoint function again and use it to calculate a point that stops the player moving if the hill is too steep. i have chosen the latter because it is easier and will run quicker.
First we need to change the land movieClip so that it has some steep hills at either side of the screen.
Next we have to create the new hitTest functions.
some code, just the new run function again.

PLAIN TEXT
Actionscript:
  1. function run(event:Event) {
  2. velocity+=gravity;
  3. if (land.hitTestPoint(char.x, char.y+char.height/2, true)) {
  4. velocity = 0;
  5. char.y--;
  6. }
  7. if (!land.hitTestPoint(char.x, char.y+char.height/2+1, true)) {
  8. char.y += velocity;
  9. } else {
  10. velocity=0;
  11. if (attemptJump==true) {
  12. char.y--;
  13. velocity =-5;
  14. }
  15. }
  16. if (!land.hitTestPoint(char.x-char.width/2, char.y+char.height/4, true)) {
  17. if (goleft==true) {
  18. char.x+=lspeed;
  19. }
  20. }
  21. if (!land.hitTestPoint(char.x+char.width/2, char.y+char.height/4, true)) {
  22. if (goright==true) {
  23. char.x+=rspeed;
  24. }
  25. }
  26. }

As you can see from the code i have put the new hitTest functions in front of the move left and right functions. Lets look at the first one, the "goleft" function. i have put a conditional statement in front of the old goleft function. Note the exclamation mark in front. This means that you can go left only if the character's left hand side, a quarter up from the foot, is not touching the land.
It is nearly the same code for the goright function, but if look carefully, you will see that instead of a "char.x-char.width/2" we have a "char.x+char.width/2" this is just declaring a point on the right side instead of the left.
Heres a demo
As you can see, the demo runs fine, you can't walk up steep hills but you can still jump up them. Thats fine for now.
In the next tutorial i am going to see what happens if i add a floating platform that you can go underneath and jump on to.
Previous Entries Next Entries
Powered by WordPress .::. Designed by SiteGround Web Hosting

cssandhtml