TAILIEUCHUNG - Creating Mobile Games Using Java phần 3

mà không có sự cho phép trước bằng văn bản của chủ sở hữu quyền tác giả và nhà xuất và bị ràng buộc tại Hoa Kỳ của Mỹ đăng kí nhãn hiệu tên có thể xuất hiện trong cuốn sách này. Thay vì sử dụng một biểu tượng thương hiệu | 78 CHAPTERS USING THE MIDP 2 GAMES API that evendnougha Spriteisrepresentedbyo nly one image at a time it can be easily repre-o _I-. seated by different Unages under differentjCircumstances. including by a series ofimages that Simpo PDFiMergeana p WLe tereqVersI rmb ji W simD0P cQra. make tip an animation. Th my example game me cowboy has three differenrimages m which he swalkingandoneinwhichhe imagosusedloragivenSpri ten eed Io be storedSogudiee in a singl r imagefOe. Toindroate whne ioltnd dieimagel ile toure ocnd theaddressoSthe image within thoJAR in the samn format diabi uecdtn I indrwsoSlices in Ihe method Clae a .gohhosone ceor oeaChnptee Idoemoredeiaine. Mglhelf Ire met arcrO hedin a single leu geobje ci whéuhih g eonvunidgou ihut mo aniyoudanUhavetomanihMalu multiple Image nUjeeis todctcemincivhichlaeeyoueS roieeiewnuaino ai anggévdniimd. Oiguue 3-3 shows thn iuence . Figure 3-3. The image file to use for the cowboy Sprite Thd tumbldWddd imagd file consists of throe frames that give a rolling animation when shown in sequence seeFigure 3-d . Figure 3-4. The tumbleweed image The way to select which frame is shown at any given time is intuitive. First if your image file comprises midhjile IrFFges-asdiFse-wo do you should construct the Sprite with the constructor that specifies the width and height in pixels that you d like your Sprite to be. The width and heightofehuImaeeshogObe inieaormeill liieuoCMu widthand hedehtyeu send to thechusteureue iA -4110 01x1 heeomputer should bfahiete hiiOde hhucmtheofsis evenly intchecthhciesneihesh aud uspacilyAs yonconscc i om examiles eoe CHAPTERS USING THE MIDP 2 GAMES API 79 can arrange the subimages arranged horizontally or vertically. Youcaneven arrange themin ._ A grid with multinleAQWs and col I oidenj i ly .the ibdiyidual frames they re num- Simpo PDFMerae ana SblftXniregiswreOersm L r Derea staffing with zero at me top-left corner continuing tome .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.