. Community ▼. Resources ▼. Other ▼. is software designed to make developing games easy and fun. It features a unique 'Drag-and-Drop' system which allows non-programmers to make simple games. Additionally, experienced coders can take advantage of its built in scripting language, 'GML' to design and create fully-featured, professional grade games.
Content that does not follow the is subject to deletion, so please become familiar with them.
. Community ▼. Resources ▼.
Other ▼. is software designed to make developing games easy and fun. It features a unique 'Drag-and-Drop' system which allows non-programmers to make simple games. Additionally, experienced coders can take advantage of its built in scripting language, 'GML' to design and create fully-featured, professional grade games. Content that does not follow the is subject to deletion, so please become familiar with them. It really depends on what you want to do with it.
Data Structures have a suite of fantastic functions (sorting, shuffling, summing an area, locating values, etc) for using and manipulating them. If you need those sort of functions, then I say use a data structure. The ONLY time I use an array in my current project is a value I call aivalues. It's a 1 dimensional array that holds a random, unrelated set of values for my ai to communicate with itself between steps and finite states (rather than creating x amount of variables for any random thing I may need to save just for the AI).
Could be a timer I'm keeping track of, or a direction decision, etc. Because the values just need to be stored and not compared to each other, and I never need to look in the array for a specific value, etc, it works great for that. I'm a HUGE fan of data structures, though, and probably over use them. 'God' might be a bit of an overstatement. The guys at D-Pad or Vlambeer or even Tom Francis are Gods. I suck at making games, but I like solving problems and teaching people.
![]()
Basically what I want is to have items array like this itemsa,b - a indicates the sprite, and b indicates the imageindex of this sprite example: items0,0= sword, grade1 items0,1= sword, grade2 items0,2= sword, grade3 items1,0=armor, grade1 items1,1=armor, grade2 items1,2=armor, grade3. And inventory I want it to be in grid like 5x6.
Cayenne klein casting woodman. Choose Pornhub.com for Cayenne Klein naked in an incredible selection of hardcore FREE Porn videos. Jan 15, 2006 She is now also at Alsscan - but there are hardly any pics available. If someone finds something new.
I dont want to use 1 sprite for all the items cuz if I later add any updates to my game it will be much easier. And for stats I was thinking to just add in sword/armor object: if imageindex=0 dmg=1 if imageindex=1 dmg=2 Or you maybe got better idea? Im just an beginner, still dont know what is the best to do. First thing you are doing wrong: When you 'pick up' the item, you don't need to do a dsgridget(items,0,argument0); Just do this: global.inventoryi=argument0; Why?
You just need a reference for how to find details of the item. Right now you are setting global.inventoryi to 'sprsword'. That should fix your drawing script as well if I'm reading it right. That's another issue. You are storing your sprites as 'strings'. Just do sprsword, not 'sprsword'.
It also seems like you are missing a for loop in your pickup script that loops through all the inventory slots. But you probably just omitted that in your post. On the webz i saw ppl saying to destroy dsgrid/list when you don't need it Yes. You NEED to destroy the list, but no you don't want to destroy it there. When you have a script that returns a list, you need to delete it after you are done with it. Also, any code after 'return' is NEVER executed, so where you have the dslistdestroy right now would never be hit. So, what you need to do is destroy it when you use the script: var list = damage(crit,damage,firechance,firedmg); //do things with list.
//done doing things with list. Dslistdestroy(list); If you don't destroy lists and grids when you are done using them they will just sit around in memory.
2d Array Python
If you are doing this often throughout your game, you have what's called a 'memory leak' and it will eventually overflow and crash your game. Typically, where possible I'll write dslistcreate and dslistdelete at the same time, just to make sure I have it cleaned up. Additionally, if you have an object that creates data structures, deleting that object DOES NOT DELETE THE DATA STRUCTURES! I typically have some destroy event code that cleans up data structures on any object that uses them. It works, yay!
Now I got another question:s (sry for being annoying) How do ppl usually pick up items from inventory(stick it to mouse so it can be moved to character). With other game I made I used objects for every item, so that's pretty easy, but for this one I have no idea(how to pick up sprite). And does the game use more memory if I make big grid and some slots are empty?
2d Array Java
Descargar nacho libre audio latino mp4 free. For example I got 12 swords, 5 talismans, and I make grid 5x30 so I use slots 0-12 for sword (13-20 I leave empty for the swords I will add in the future) and slot 21-25 for talismans (and 26-30 for future updates) so when enemy is killed its easier to roll for item drop(if I want monster to drop sword I would write irandom(12) and when I add new weapon in the game I just change to irandom(13).
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |