Главная » Просмотр файлов » Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008

Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (779888), страница 65

Файл №779888 Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (Symbian Books) 65 страницаWiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (779888) страница 652018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 65)

It then checks for collisions or other events that must behandled (such as picking up bonus points).public class GameEngine extends LayerManager{...public static final int GRAVITY = 10;public static final int TERMINAL_VELOCITY = 50;public static final int FIRE_TICK_RATE = 2;public static final int BASE_RUNNING_SPEED = 10;public static final int JUMP_FORCE_NORMAL = 3;public static final int BURN_TICKS = 5;...public void integrateWorld(){try{tickHero();tickWorldItems();updateWorldState();}catch(Exception e){e.printStackTrace();}}private void tickHero(){if(isJumping()){hero.setVerticalSpeed(stepJumpSequence());}else if(isFalling()){hero.setVerticalSpeed(stepFallSequence());}else if(isOnPlatform()){hero.setVerticalSpeed(platforms[currentPlatformIndex].getSpeed());}hero.tick();}9.9.4 World ObjectsThe objects in this game consist of the Hero, FlipSprite, Fire,Platform and Background classes.

Of these, the first two are specializations of the Sprite class, while the rest are derived from theTiledLayer class. FlipSprites simply oscillate between two statesconstantly to form a simple and cheap animation. They are used forbonuses, the Rings of Fire and health power-ups. The Fire class is a tiledlayer that can be dynamically built to fill the available screen width, andthe Platform is a tiled layer to allow for random sizes.

These objectsare built using the world object frames shown in Figure 9.4.The Background class contains a number of artifacts and animatedtiles. It is created using the image shown in Figure 9.5.The Hero is implemented as a finite state machine with the engineresponsible for effecting state transitions. This approach allows the hero’sDID YOU HEAR THAT SNAP?289Figure 9.4 World object framesFigure 9.5 Background tilesanimation sequences to be switched in a well defined context-sensitivemanner throughout the entire game.

Note that, by design, world objectssuch as the Hero don’t know anything about game physics and don’tmake any decisions for themselves. They’re just sprites, so they reallyonly need to know where they are, where to move to and how theyshould look on the way there.9.9.5 Game EffectsThe game uses a series of hard coded byte arrays as tone sequencesthrough the Game Effects class. These are triggered by game eventssuch as incurring damage, gaining health or bonuses, achieving death orfinishing the game. Vibrations are also used when the hero falls onto aplatform from a given height (so it won’t always happen which is good asyou don’t want to drain the battery). Both of these effects can be turnedoff on the Options screen.9.10 Did You Hear That SNAP?Mobile game playing is a force to be reckoned with. As a concept, we’reall aware that it has driven innovation, technology, and business over thelast decade or so, but its effect, in terms of our societal interactions andexpectations, is much more profound.

We think nothing of spending hoursonline playing games with people that we’ll never meet, in countries thatwe’ll never visit. People are paying others to play online games such asWorld of Warcraft, accruing virtual assets on their behalf, and anonymousentities known only by their handles can live in a world where their gameskills reign supreme.With trends like this, it’s important to consider multiplayer gamedevelopment in the mobile space.

This is not a particularly new ideaand has been done for years now by a wide range of game development290MIDP GAMES ON SYMBIAN OScompanies. Already, 45 % of people who play mobile games play onlinemultiplayer games at least once a month, according to research describedin the SNAP Mobile literature on www.forum.nokia.com.4 However it’sbecome pretty clear that there exists a useful abstraction of multiplayerfunctionalities which are independent of any particular game – suchas challenging someone (or anyone) to a new game, ranking players, or sending game packets using robust network protocols, friendlists, authentication, etc. This is what the Scalable Network ApplicationPackage (SNAP) from Nokia addresses.Earlier in the book, in Chapter 5, Jo talked about the Arena technologydeveloped for the Nokia N-Gage.

The SNAP Mobile SDK is the Java MEclient API for interfacing to the same backend framework, as shown inFigure 9.6. SNAP works for pretty much any Java ME device currentlyon the market. The only requirements are MIDP 2.0 and CLDC 1.0. It’sincluded with the Sun Java Wireless Toolkit or you can download itseparately from Forum Nokia (the URL is far too long to type in, butyou can find it by searching for ‘SNAP Mobile SDK’) or from the SNAPMobile website at snapmobile.nokia.com. It comes with a suite of sampleapplications to get you started straight away as well as an emulator to runlocally to simulate the SNAP framework servers.SNAP Mobile allows developers to focus on the game code ratherthan on network programming. Which makes a lot of sense – all youneed to do is implement a few interfaces which serve as callbacksfor the SNAP servers, and you’ve built your first SNAP Mobile game.Online Community ServicesSNAP Mobile ClientsJava GameSNAP Mobile GatewaySNAP Mobile APIMobile DeviceJVMWeb servicesOperator Gateway(operator IP)Java GameAuthenticationdatabaseSNAP Mobile APIJVMMobile DeviceIMPS servicesJava GameSNAP Mobile APIJVMMobile DeviceOperator Gateway(operator IP)SNAP Game servicesFigure 9.6 SNAP framework architecture4Additional information, specifically for SNAP developers, can also be found on ForumNokia at www.forum.nokia.com/main/market segments/games/snap mobile.html.DID YOU HEAR THAT SNAP?291Clearly, this is going to speed up the development cycle and lower budgets immensely, since, generally, game programmers aren’t necessarilynetwork programmers.The framework supplies standardized access to a variety of servicesfrom a SNAP game via a robust architecture.

It provides a single point ofcontact between Java ME clients and community services, authentication,and account creation, session management, scalability, load balancingand routing services.SNAP Mobile features fall naturally into three main categories:• in-game community• in-game connected game playing• out-of-game community features.9.10.1 In-Game CommunitySNAP games allow users to access some pretty cool community featureswhile still playing the game:• friends list – the user’s contact list in the online gaming community.This is a list of people you can chat with, send messages to, orchallenge to a new game.

You can also invite others to join andaccept invitations to join other lists• instant messaging/chat – send messages to friends and other userswhether they are offline or online or whether they are in a lobby or agame room• presence – indicators identifying friends who are online, offline, playing the same game or not to be disturbed. This has the effect of actuallyencouraging game playing• unique user identities – SNAP supports online handles rather thanusing phone numbers or real names. This handle is retained by theuser and used in all interactions with the SNAP framework – whetheraccessing the gaming community via a PC or a handset• rankings – player statistics (scores and standings), top-ranked playersand proximity rankings (ranking with respect to other players of similarstandings) are all calculated as SNAP games report scores back to theSNAP servers for centralized storage. Again, this encourages onlinegame playing and competition between players.9.10.2 In-Game Connected Game PlayingSNAP Mobile has a variety of concepts that support multiplayer gameplaying:292MIDP GAMES ON SYMBIAN OS• lobbies and game rooms – these are virtual concepts: games takeplace in game rooms and lobbies contains game rooms.

This offers aplace for users to meet, chat and play• head-to-head connected game playing – users can play against oneanother from start to finish via peer-to-router-to-peer game sessions• pervasive world games – always on, multiplayer sessions means thatusers from anywhere in the world can enter play and leave at anytime• matchmaking – SNAP Mobile has four modes for this: Challenge mode(where one player specifically requests a certain opponent), Randommode (automatically assigned to any available player in any gameroom), Join mode (player joins a specific game room), and Sort startmode (which uses a configurable load balancer to place users in gamerooms).9.10.3 Out-of-Game Community FeaturesSNAP Mobile offers a variety of concepts that support out-of-gamecommunity features:• rankings – allow a more detailed view of the ranking statistics thatare accessible from within a game as the interface isn’t limited to themobile screen• support – phone settings, FAQs, trouble shooting guides, and so on• featured game pages – game pages, information and screenshots frompopular games• message boards – for messaging regarding games and communityrelated topics.

Характеристики

Тип файла
PDF-файл
Размер
2,71 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6455
Авторов
на СтудИзбе
305
Средний доход
с одного платного файла
Обучение Подробнее