Programming 2D Scrolling Games. Updated for PureBasic 4.61 & 5.0
Book information
Description
Contents......Page 4 --- PureBasic Basics......Page 8 What is PureBasic......Page 9 Major Sections of this Book......Page 10 Conventions......Page 11 Errors in the book or code......Page 12 What is a Program......Page 13 Bits & Bytes......Page 14 Screen Resolutions & Bit-Depth......Page 15 Speed Impact of Higher Resolutions & Bit-Depths......Page 16 DirectX, Peripheral Cards & Drivers......Page 17 Creative & Technical Design Documents......Page 18 Good Coding Style & Commenting......Page 19 Place to work......Page 20 OpenConsole......Page 21 OpenWindow......Page 22 OpenScreen......Page 24 Variables......Page 27 Defining Variables......Page 30 Commenting......Page 33 Simple Arithmetic......Page 35 Cartesian Coordinates......Page 36 IF...ELSE...ENDIF......Page 39 Nested IFs......Page 42 AND & OR......Page 43 SELECT......Page 45 Loop Basics......Page 46 FOR...NEXT......Page 47 WHILE...WHEND......Page 50 REPEAT...UNTIL/FOREVER......Page 53 What Arrays look like......Page 56 Initializing an Array (DIM command)......Page 57 Multidimensional Arrays......Page 59 Re-dimensioning Arrays......Page 62 Loading Data Values into an Array......Page 63 Variable Length Data Statements......Page 69 Arrays of Structures......Page 71 Arrays within Structures......Page 75 Basic Structure Lists......Page 76 Advanced Operations – Extending Structures......Page 81 Advanced Structure Operations – Pointers......Page 85 Other List Commands......Page 89 *MemoryBuffer = AllocateMemory(NumberOfBytes)......Page 91 Value = PeekB(*MemoryID)......Page 92 ReAllocateMemory(*MemoryID,10)......Page 94 CopyMemory(*SourceMemoryID,*DestinationMemoryID,Length)......Page 96 Comparing Memory......Page 98 String-Specific Commands......Page 100 Declare. ProcedureName (Arguments)......Page 104 Passing Arguments & Returning Results......Page 107 Including Files......Page 111 Libraries......Page 112 Creating a File......Page 116 Writing to a File......Page 117 WriteData(FilePtr, *MemoryBufferID, LengthToWrite)......Page 118 FilePtr = ReadFile(#File,FileName.s)......Page 119 Length = ReadData(FilePtr ,*MemoryBufferID,LengthToRead)......Page 120 Moving around inside of Files......Page 121 Result = Eof(#File)......Page 122 Quick Binary Example......Page 124 Miscellaneous File Commands......Page 126 --- Game Tools......Page 128 FrontColor(Red,Green,Blue)......Page 129 Pixels......Page 130 Lines......Page 132 Line(StartX, StartY, Width, Height, [optional color])......Page 133 Box(StartX, StartY, Width, Height, [Optional Color])......Page 135 Ellipse(X, Y, RadiusX, RadiusY, [Optional Color])......Page 137 Result = LoadSprite(SpriteNumber, FileName [,Optional Mode])......Page 138 DisplaySprite(SpriteNumber, X, Y)......Page 139 Rotating Image to make Multiple Frames......Page 141 Writing directly to a Sprite......Page 147 Page Flip Animation......Page 149 Animating Images......Page 153 Animation Timing......Page 157 Bounding Box Collisions......Page 161 SpriteCollision (Sprite1,X,Y,Sprite2,X,Y)......Page 162 Pixel-Perfect Collision Detection......Page 166 Keyboard......Page 171 Mouse......Page 172 Custom Mouse Cursor......Page 176 Joystick......Page 177 Loading Sounds......Page 181 Manipulating Sounds......Page 183 Multiple Sounds Playing Simultaneously......Page 188 Loading Sounds into Memory......Page 189 Overlaying Multiple Sounds......Page 192 Playing Music......Page 197 Music Modules......Page 198 Frames per Second (FPS) Tracking......Page 200 The Rolling Timer......Page 202 Locking in at Real Time......Page 205 --- Migz Callo - Laser Blazer......Page 212 Background Story......Page 213 Art Asset List......Page 214 Sound Asset List......Page 221 Technical List......Page 222 Z-Ordering......Page 223 Implement Z-Ordering......Page 224 Loading Tiles......Page 228 Loading Map Dimensions......Page 233 Loading the Map Data......Page 235 Loading Binary Maps......Page 237 Saving Binary Maps......Page 239 Showing a Loaded Map......Page 240 Player hits a wall......Page 245 Screen and World Coordinates......Page 252 Scrolling a Map (Theory)......Page 253 Edge-Independent Scrolling......Page 254 Scrolling Code......Page 256 Screen Vs. World......Page 260 Robots, HealthPaks, and Lasers…oh my!......Page 262 Robots Doing Stuff......Page 264 Robots Firing......Page 266 Migz Gets Bored......Page 268 Migz Falls Asleep......Page 270 The main loop......Page 272 Making a level for Migz......Page 277 Placing robots & healthpaks......Page 278 Code for starting a level......Page 280 Conclusion......Page 283 Appendix......Page 284 License......Page 288 My other Work......Page 289
Similar books
Programming 2D Scrolling Games. Updated for PureBasic 4.61 & 5.0 (source code)
2014 · RAR
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF