![]() That means that a lot of things are handled for me such as gravity, forces, and collisions… basically all the physics code. ![]() Distance joints, which I’ll cover in a minute, are not powered by motors, so I just increment or decrement the length to move it up or down. The tick function handles the actual movement via the game loop. The goUp and goDown simply set flags so the elevator knows where to go. ![]() The only thing to really note is the goUp, goDown, and tick functions. The elevator does not move on it’s own, only when a button is pressed. You can optionally walk into the elevator and press the up or down buttons for the same effect. You press a button and the elevator will arrive at the floor the button was pressed. The character is on the 12th floor and needs to use the standard elevator. It’s based on a Brooklyn apartment building that has 13 floors with 12 ft ceilings. Kind of like they do in the real world.Ī game I’m building requires that a character inside a building go up a floor in the building he is in. It also helps players in games get from one floor to another in a controlled manner. Many writers play up the claustrophobia aspect, the lack of control as a metaphor for life taking us where it wills to, or preying on our fear of the unknown when you hear bad things just outside the lift walls. In such a confined space clearly only meant for short periods of stay, elevators can force us to view the human condition ever more clearly. If you shoot the overhead speaker, Max utters a smirk filled, 2nd word annunciated “ Thank you!“. Combined with the absurd brightness in the elevator’s interior amongst a very noir game, the tell tale “elevator muzak” is playing. You walk into a shoddy NYC apartment building elevator alone, with the notorious off-kilter 3rd person camera. One of my favorite easter eggs was from Max Payne was in an elevator. In a lot of horror movies, they actually are the focal point of a lot of scary scenes such as Resident Evil, and also provide a perfect setting for comedic relief such as such as Spiderman 2 and Deep Rising (good ole Ipanema). They also provide easier ways for game developers to unload and load a level, provide a rest for the player, and/or make it easy to provide cut scene dialogue to prepare for the player for an upcoming part. Thus, some of the issues and compensation measures I took may not need to be done, nor happen, in other implementations and platforms.Įlevators provide an interesting transition in both games and movies. Please keep in mind some of the things below are related to Corona SDK’s implementation of Box2D. The following article talks about how I’m using Box2D in my game, the 4 approaches I took to building an elevator, and what I eventually decided upon. I’m still learning the ins and outs of Box2D as it relates to game development, so wanted to report on how I went about it and what I learned. Getting the physics to work proved way more challenging than I anticipated. I wrote the actual code and API for it in about 30 minutes. It took me 4 days to build an Elevator via Box2D in Corona SDK.
0 Comments
Leave a Reply. |