How would you detect a ground like this:

I have made racing games in the past, but never a side scrolling type.
Im trying to make one similar to this: http://www.gamesfreak.net/games/Cyclo-Maniacs_3730.html
But how would you keep the player on the ground? well not stuck to the ground because we would want the player to be able to use things like ramps.
Would it be a hit test? hmmmmmmmm Any ideas? anyone.

Oh i apoligize. I pressumed because of the popularity of box2D you meant that. Well the code I have so far does a OK job for physics. Allthough i made it in intensions of a platform/side scroller. But its ok. I guess it could possibly be  modified for a car or something.
Here is what i have so far:
package
          import flash.display.MovieClip;
          import flash.events.Event;
          import flash.events.MouseEvent;
          import flash.events.KeyboardEvent;
          import flash.geom.Point;
          public class DocumentMain extends MovieClip
                    public var _startMarker:StartMarker = new StartMarker;
                    public var _Player:Player;
                    public var _Boundaries:Boundaries;
                    public var _Wall:Wall;
                    public var _Floor:Floor;
                    public var _LButton:LButton = new LButton;
                    public var _RButton:RButton = new RButton;
                    public var _UButton:UButton = new UButton;
                    public var _DButton:DButton = new DButton;
                    private var _vy:Number;
                    private var _vx:Number;
                    public function DocumentMain()
                              stage.focus = stage;
                              //stage.addChild(_startMarker);
                              //_startMarker.x = 300;
                              //_startMarker.y = 300;
                              stage.addChild(_LButton);
                              _LButton.x = 80;
                              _LButton.y = 600;
                              _LButton.height = 75;
                              _LButton.width = 75;
                              _LButton.addEventListener(MouseEvent.MOUSE_DOWN, LMouseDown);
                              _LButton.addEventListener(MouseEvent.MOUSE_UP, LMouseUp);
                              stage.addChild(_RButton);
                              _RButton.x = 210;
                              _RButton.y = 600;
                              _RButton.height = 75;
                              _RButton.width = 75;
                              _RButton.addEventListener(MouseEvent.MOUSE_DOWN, RMouseDown);
                              _RButton.addEventListener(MouseEvent.MOUSE_UP, RMouseUp);
                              stage.addChild(_DButton);
                              _DButton.x = 140;
                              _DButton.y = 650;
                              _DButton.height = 75;
                              _DButton.width = 75;
                              //_DButton.addEventListener(MouseEvent.MOUSE_DOWN, DMouseDown);
                              //_DButton.addEventListener(MouseEvent.MOUSE_UP, DMouseUp);
                              stage.addChild(_UButton);
                              _UButton.x = 140;
                              _UButton.y = 550;
                              _UButton.height = 75;
                              _UButton.width = 75;
                              _UButton.addEventListener(MouseEvent.MOUSE_DOWN, UpMouseDown);
                              _UButton.addEventListener(MouseEvent.MOUSE_UP, UpMouseUp);
                              _startMarker.visible = true;
                              _startMarker.x = 500;
                              _startMarker.y = 300;
                              _vx = 0;
                              _vy = 0;
                              _Player.addEventListener(MouseEvent.MOUSE_DOWN, JumpDownHandler);
                              _Player.addEventListener(MouseEvent.MOUSE_UP, JumpUpHandler);
                              this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
                              stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
                              stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
                    private function JumpDownHandler(MouseEvent):void
                              _vy = -20;
                    private function JumpUpHandler(MouseEvent):void
                              _vy = 0;
                    private function LMouseDown(MouseEvent):void
                              _vx = -20;
                    private function LMouseUp(MouseEvent):void
                              trace("LMouseUp");
                              _vx = 0;
                    private function RMouseUp(MouseEvent):void
                              _vx = 0;
                    private function RMouseDown(MouseEvent):void
                              trace("RMouseDown");
                              _vx = 20;
                    private function UpMouseDown(MouseEvent):void
                              _vy = -20;
                    private function UpMouseUp(MouseEvent):void
                              trace("UMouseUp");
                              //_vx = 0;
                    private function enterFrameHandler(e:Event):void
                              _vy +=  2;
                              //_vx += 20;
                              _Player.x += + _vx;
                              _Player.y += + _vy;
                              processAllTheCollisions();
                              scrollTheStage();
                    private function processAllTheCollisions():void
                              if (_vy > 0)
                                        if (_Player.y > 500)
                                                  _Player.x = _startMarker.x;
                                                  _Player.y = _startMarker.y;
                                                  _Boundaries.x = 0;
                                                  _Boundaries.y = 0;
                                                  _vy = 0;
                                        else
                                                  var collision:Boolean = false;
                                                  if (_Boundaries.hitTestPoint(_Player.x,_Player.y,true))
                                                            collision = true;
                                                  if (collision)
                                                            while (collision)
                                                                      _Player.y -=  0.1;
                                                                      collision = false;
                                                                      if (_Boundaries.hitTestPoint(_Player.x, _Player.y, true))
                                                                                collision = true;
                                                            _vy = 0;
                    private function scrollTheStage():void
                              _Boundaries.x += (stage.stageWidth * 0.5) - _Player.x;
                              _Player.x = stage.stageWidth * 0.5;
                              //_Boundaries.y += (stage.stage.stageHeight * 0.5) - _Player.y;
                              //_Player.y = stage.stageHeight * 0.5;
                    private function keyDownHandler(e:KeyboardEvent):void
                              switch (e.keyCode)
                                        case 37 :
                                        _vx = -20;
                                        break;
                                        case 38 :
                                        _vy = -20;
                                        break;
                                        case 39:
                                        _vx = 20;
                                        break;
                                        default:
                    private function keyUpHandler(e:KeyboardEvent):void
                              switch (e.keyCode)
                                        case 37 :
                                        case 39 :
                                        _vx = 0;
                                        break;
                                        default:

Similar Messages

  • How would you make an effect like this?

    Hi! I'm new to the forums, but hopefully it's ok if I start this new discussion. I'm very new to Photoshop as well (newbie).
    Here is the image: http://sffbookreview.files.wordpress.com/2012/10/life-of-pi-banner.png
    How would you make the image on the right - with the watercolor painting crop effect of the tiger? Also, how would you make the font on the left gradually turn to orange?
    Thanks! Your help is much appreciated.

    Hi there,
    Here's a really quick tutorial on how to add the mask and gradient text over the image of a tiger.
    Masking the Image
    1) Open your image of the tiger. There should be two layers in your layers panel: the image and a white background.
    2) With the tiger layer selected, click on the icon marked below in the layers panel to create a layer mask.
    3) Being sure you have the mask you just created selected, paint with black using the brush tool to mask out the image. In your layers panel, if you look at the mask icon, you will see the areas where you were painting (on the canvas) change to black. Use a variety of brushes to recreate the effect in your example image.
    Creating Text with a Gradient Effect
    1) Use the Type Tool to create your basic text and reposition it on the page with the Move Tool.
    2) In the layers panel, control click on the type layer and select Blending Options.
    3) In the dialog box that opens, check the Gradient Overlay box and click on the "gradient overlay" text to move to the gradient options. Adjust the angle of the gradient, then click on the colored bar to select the colors you want. Click OK on each dialog to close them.
    Final result:
    I hope this helps, and please let me know if you need any more assistance.

  • How would you implement a page like this?

    Hello
    When you look at www.autoweek.nl you see a little down 6 tab pages (Alle Rubrieken - Autonieuws etc.)
    My question is about the way you could implement the contents of one tab page.
    Would the content be several html regions (one for every message), or would it be a report? Or even something else?
    I'm struggling with the number of items. When I choose a html region for every news item I have a fixed number of HTML regions, which is not flexible.
    A report gives me this flexibility but is not that easy to layout?
    See also: http://www.autoweek.nl/nieuwsindex.php
    Any suggestions appreciated!
    Regards Erik
    Edited by: Erik Trip - Darwin IT on Nov 5, 2010 9:04 AM

    I would say a region per Tab and inside the Tab it is a report.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • How do you create a background like this...

    Hi,
    I am building a mock-up for a website and am wondering how to create a background in Photoshop like they have in the following link (where they have these thin diagnol stripes in the background of the entire page):
    http://www.neatco.com/
    I appreciate your time and look forward to hearing back from you soon.
    Thanks!

    If you Google "Photoshop diagonal pattern tutorial" you will find thousands of tutorials.

  • How do you make an image like this?

    I am sorry if this is time consuming but I saw this image on a website and it caught my attention.

    Ai is Illustrator, but a lot of digital artists use Photoshop for this sort of illustration.  I suspect most of it for the gaming industry.
    Check out Digital Tutors.  They have a number of titles that show a step by step guide to producing artwork very similar to your guide.
    Photoshop Illustration Tutorials and Training > Digital-Tutors
    BTW  I do hope this is a serious question.  The similarity of your usename to the text in the illustration, had me thinking you might be spamming this forum.  Tell me I'm wrong and I'll be happy to help.

  • How do you make a gradient like this

    Is it a linear, radial, angle, etc?
    Tried a few things but nothing is working to match it yet.
    Thanks.

    charles badland wrote:
    Unless you are using an Adjustment Layer Gradient
    Right idea, slightly wrong terminology.  It's actually a Fill Layer on which you can make a gradient, then edit its characteristics.
    Once you have such a Fill Layer created, you can edit it by double clicking the gradient icon in the Layers panel, and you can move its position by unchecking "Align with layer" then moving the center by dragging it while the Gradient Fill dialog is still open:
    -Noel

  • How do I create an image like this?

    Completely new to PS. How would I create an image like this with text? https://www.facebook.com/photo.php?fbid=10151570901245020&set=pb.50687255019.-2207520000.1 366989903.&type=3&theater
    A link to a tutorial would be helpful.
    Thanks!

    Hi there,
    Are you referring to the text, the color effect, or both?
    Adding type is very easy - just grab the Type Tool from the tool bar. The article linked above provides some great tips for editing type in Photoshop.
    As is the case with many "how to's" for Photoshop, there are several ways to acheive the colorized effect like the one applied to image you linked to. One method is to use Adjustment Layers, which I have outlined below.
    1. With your image layer active (it will be highlighted in blue in your Layers panel, as shown below), create a selection of the area you'd like to colorize. I'm using the Polygonal Lasso Tool to create a diagonal selection - to do so, I held down the Shift key on my keyboard as a created my diagonal lines. This might take a bit of practice, but you'll get the hang of it quickly.
    2. Then, in your Adjustments panel (if you don't see it, go to Window > Adjustments), click on the Curves adjustment layer, as highlighted below. Now you can play around with the curves to get the effect you'd like. (Here's a quick guide on using the Curve tool)
    3. To select the other areas of your image, command (Mac) / control (PC) click on the adjustment layer thumbnail (highlighted below). Then, go to Select > Inverse.
    4. Now we want to deselect part of our selection. Grab the Quick Selection Tool from the toolbar and set it to Subract from selection. Then, simply drag the selection brush over the area you want to deselect. In my case, I only want to have the upper-left corner of my image selected.
    5. After you have your selection, click on the image layer and add a Curves adjustment layer like before.
    6. Repeat steps 3-5 for the other corner of your image and you should end up with something like this:
    The nice thing about using adjustment layers is that you can always change them - just double click on the Adjustment layer thumbnail (highlighted in step 3).
    Alternatively, you can select areas of your image and fill the selections with flat colors on separate layers. You can then go in a change the Blend Mode and Opacity for each layer.
    Feel free to reply with any questions!
    Kendall

  • Disable the pop-up message box "How would you like to open this file" to open pdf file??

    Hi,
    is there any way i can stop the pop-up box displaying to open pdf file in sharepoint document library? Right now whenever i am trying to open pdf file, asking "how would you like to open"  Read only or edit mode. currently MIME Type is setup
    but still pop-up message box.
    Thanks in advanced!

    Hi ,
    As far as I know, This is a default feature. and is not recommended to delete or deactivate this pop up. 
    This is a feature of office and there is a dll called owssupp.dll which is responsible for getting the popup to open.
    You can go to IE tools> addon settings and deactivate the above dll (sharepoint open document class). But if you do so, then the other office office files which are word/excel/pptx etc.. would aslo gets affected and they also wont get the popup.
    Hope this helps.
    Best Regards, Ashok Yadala

  • Problem with the Photomail option within " How would you like to share ?"

    I have a PC with Windows 7 and Elements 10 installed. For the past couple of days, when I attempt to share photos using the Photomail option under "How would you like to share ?" column , after selecting the recipient, I get an error message dialogue box that says : "Elements 10 Organizer has stopped working - a problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available". Then the Organizer stays closed down until I reopen it. However, I am able to share photos using the "Email Attachment" option.
    What could be wrong with the "Photomail" option ?
    Thanks

    Hi,
    I have seen this sort of failure caused by a permissions problem.
    Try this:
    Close elements
    Create a shortcut on your desktop which goes direct to the organizer
    Right click on that shortcut and select "Run as Administrator" (even if you are an administrator)
    Now try your Photomail again
    If it does work, you only need to do this once, it seems to correct itself after that.
    Good luck
    Brian

  • Advice - how would you do this?

    I have a compound path (an inner rectangle and an outer one) in an opacity mask. I have to apply an b/w gradient from the outer to the inner ractangle.
    I can only find a feature to add circular an linear gradients!
    How would you do this?

    haemse,
    Transitions like this are made with Blends; Object>Blend>Options to ensure the options you want, then Object>Blend>Make.
    In this case you may:
    1) Object>Compound Path>Release;
    2) For each rectangle, set Stroke to the Fill Color and set Fill to None;
    3) Select both and Object>Blend>Make (keep it Smooth).
    In other words replace the Compound Path with a Blend.

  • How would you guys block portable Apps like Skype,firefox,Kproxy and gtalk etc etc ?

    Hi,
    how would you guys block portable Apps like Skype,firefox,Kproxy and gtalk etc etc ?
    it just runs from USB / Local HDD .
     obviously I could just block all USB ports but is there a better way?

    Hi,
    Preventing users from running portable applications can be done through:
    Configuring specific User Account Control Settings
    Software Restriction Policies
    AppLocker
    More information, please check this similar thread:
    How to block portable application & prevent installation on Active Directory?
    http://social.technet.microsoft.com/Forums/en-US/winserverGP/thread/dfd21e22-b245-4d2b-b9c7-912fe357653e/
    Hope this helps!
    Regards.
    Vivian Wang
    TechNet Community Support

  • I need to change my apple id in my ipod (it was an old email address).  How would you do this?

    I need to change my apple ID in my ipod touch (it was an old email address).  I have changed to setting in itunes.  How would you do this? - not sure what my OS is.

    Go to Settings>Store (or Settings>iTunes and App Stores for iOS 6) and sign out and sign in with the other/updated account.

  • VI Analyzer - How Would You Configure It for This Use Case?

    My group has different people working on different LVPROJs for each software deliverable we have. Each LVPROJ uses our user.libs and instr.libs, as well as an overall "framework" that is the same for most LVPROJs.
    I really think the VI Analyzer toolkit would be powerful for code reviews, but only if I can configure it in a way where which tests I run and what the criteria are can be saved and used on any project. I can't seem to get this to work for me. I want to save all those configurations, and use it on new LVPROJs easily - the easier I can make this process, the more inclined others will be to use this for code review. How would you do it? (if it's even feasible)
    Solved!
    Go to Solution.

    I suggest creating a .cfg file without a project linkage, but with all the tests selected and configured as you want...so a .cfg file with no "Items to Analyze" specified. Then, when working on an individual project, open that CFG file, add the project's top-level folder to the analysis, then save that CFG file with that project. This means you can't have the project linkage in your CFG file, but assuming your project is all within some top-level folder, that shouldn't be much of an issue, since the CFG file will be "linked" at that point to the top-level folder containing your project.
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Dates : How would you do this.

    mx:DateChooser has a selectableRange property where you can set a rangeStart and a rangeEnd...
    Is it possible, or how would you go about doing it so it's a nonSelectable range.
    a user clicks on 3 days, so the calendar marks that off, so another user won't be able to select those same 3 days type of thing...

    d'oh
    .disabledRanges
    *SIGH*

  • How would YOU retype these old XM08 types for use in an ABAP OO method?

    The XM08 function group has the following type declarations:
    TYPES: BEGIN OF mmcr_drseg_co.
            INCLUDE STRUCTURE cobl_mrm_d.
    TYPES: cr LIKE drseg_cr    OCCURS 0,
           unpl_refwr TYPE refwr,
           END OF mmcr_drseg_co.
    TYPES: mmcr_tdrseg TYPE mmcr_drseg OCCURS 0,
    TYPES: BEGIN OF mmcr_drseg.
            INCLUDE STRUCTURE drseg.
    TYPES: cr LIKE drseg_cr OCCURS 0,
           co TYPE mmcr_drseg_co OCCURS 0,
           sm LIKE drseg_sm OCCURS 0,
           charact TYPE rbcharact_instance OCCURS 3,
                                           "instances of characteristics
           uebgmat  TYPE matnr,
           uebrblgp TYPE rblgp,
           selkz_db TYPE selkz,
           rblgp_old TYPE rblgp,           "rblgp before aggregation
           END OF mmcr_drseg.
    How would YOU redeclare these types so that they work in an ABAP Objects class?  
    Some of the "fixes" are easy, like replacing "LIKE" with "TYPE:".
    But what about the "INCLUDE STRUCTURE" and the "occurs 0" specifications?
    The reason I'm asking this is that I have to call a method from ZXM08U16 and I'd like to be able to pass this method exactly what XXM08U16 gets from SAP, i.e. the table E_TDRSEG of type  MMCR_TDRSEG

    David,
    I wonder it can be directly in ABAP (I would like to hear opinions from others as well!), I needed to use Data Dictionary as well:
    TYPES: BEGIN OF mmcr_drseg_co.
            INCLUDE STRUCTURE cobl_mrm_d.
    TYPES: cr TYPE z_tt_drseg_cr,
           unpl_refwr TYPE refwr,
           END OF mmcr_drseg_co.
    z_tt_drseg_cr is a table type created in SE11, based on structure drseg_cr.
    the way to create internal table and work area, based on the above:
    DATA : gt_... TYPE TABLE OF mmcr_drseg_co.
    DATA : gw_... TYPE mmcr_drseg_co.
    hope this helps some
    ec
    UPDATE : Rich is right, it is possible to do it only in ABAP with the DEFAULT KEY addition.

Maybe you are looking for

  • Using a laptop as a second screen

    I have a G5 desk top and an old G4 power mac laptop. Is there any way to use the laptop screen as a second monitor for the desk top? Would be very handy to have that extra screen for FCP?

  • Help required on Mask functionality..

    Hi Gurus, One of our Client has a requirement that the catalog items should be available to the users specific to their Company codes. For this purpose I have created a custom field in the "Catalog Items" table as Co.Code. Created users & roles. Made

  • 6110 navigation question?

    I have got my navigation working with nokia maps on the free version with no voice activation.installed with the phone is route 66 nav software,should this also work the same where navigation works but with no sound??

  • Cannot import MIDI by drag and drop from Finder

    Cannot import MIDI by drag and drop from Finder. Try a MIDI file from http://rock.mididb.com/beatles/ and see if it works for you.

  • Unable to "See" all photos in newly sent Photocast

    On Wed. evening (it is now Friday morning), my son sent me a Photocast with 16 photos. Then yesterday morning he added 15 more. Even though the syncing symbol spins around (I've prompted it many times), the new 15 did not come through. I just had the