GameMaker Language: An In-Depth Guide by Benjamin Anderson
Author:Benjamin Anderson
Language: eng
Format: mobi
Publisher: HeartBeast Studios
You can set the state in almost the same way.
state=state.walk;
Executing the state will be done in exactly the same way. In the chapter on artificial intelligence, I go through a basic example of how you can use enums and states to create artificial intelligence for your enemies; if this section is a little confusing to you, be sure to check there for an in-game example.
Creating Pseudo-Objects using Arrays and Enums
While developing this book, I’ve been working on a method for creating arrays that are similar to objects. There are many situations in which you need to store some information in an organized way and access it later, but where creating an actual object in your game would be overkill, because the built-in objects in GameMaker come with a lot of extra baggage. Of course, it is possible to use ds_maps for this, but maps can become bloated and difficult to manage if you try to go three levels down (for example, if you try to access a map data structure that is nested inside another map data structure). I can simulate the three-level depth using a 2d array and a few enums. Let me show you what I mean:
enum base {
name=0,
hp=1,
att=2,
def=3,
spd=4
}
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Art of Coaching Workbook by Elena Aguilar(50975)
Trainspotting by Irvine Welsh(21518)
Twilight of the Idols With the Antichrist and Ecce Homo by Friedrich Nietzsche(18501)
Fangirl by Rainbow Rowell(9095)
Periodization Training for Sports by Tudor Bompa(8168)
Change Your Questions, Change Your Life by Marilee Adams(7634)
This Is How You Lose Her by Junot Diaz(6788)
Asking the Right Questions: A Guide to Critical Thinking by M. Neil Browne & Stuart M. Keeley(5631)
Grit by Angela Duckworth(5513)
Red Sparrow by Jason Matthews(5390)
Paper Towns by Green John(5087)
Room 212 by Kate Stewart(5035)
Ken Follett - World without end by Ken Follett(4643)
Housekeeping by Marilynne Robinson(4337)
The Sports Rules Book by Human Kinetics(4290)
Double Down (Diary of a Wimpy Kid Book 11) by Jeff Kinney(4206)
Papillon (English) by Henri Charrière(4195)
The Motorcycle Diaries by Ernesto Che Guevara(4009)
Exercise Technique Manual for Resistance Training by National Strength & Conditioning Association(3955)