PBG's ADVENTURE! (Yeah!) - Printable Version +- The VG Resource (https://www.vg-resource.com) +-- Forum: Creativity (https://www.vg-resource.com/forum-126.html) +--- Forum: Game Development (https://www.vg-resource.com/forum-129.html) +--- Thread: PBG's ADVENTURE! (Yeah!) (/thread-27609.html) Pages:
1
2
|
PBG's ADVENTURE! (Yeah!) - Joxon - 08-17-2015 LATEST BUIL https://www.dropbox.com/s/lhm2ytlwfai7s8i/pbgs%20adventure%21.exe?dl=0 FRICK IT. ALPHA TEST 1: I'm making this a thing. It is a thing. I'm rebuilding the engine, as the previous engines coding was a big mess of text. I've sorted it out, and so far it's working out. What you'll see is a test room with the current sprite set. No tileset however. Controls are simple; WASD=Move Space=Jump Shift=run I'll be adjusting the run to use momentum soon. Now, what would be the best way to make: -a frame long landing sprite -a heart based health bar -text boxes RPG style UPDATE: tiles and placeholder background added, sword added. Aerial spin attack i-- EDIT: Added aerial spin attack with place holder sprite. UPDATE 2: Aerial attack has a new sprite, you can roll if you use the attack close enough to the ground. Hold K to use the attack longer. Added platforms you can jump through. One test ball enemy. Use F8 to restart the test. Hurt sprite is WIP. RE: PBG's ADVENTURE! (Yeah!) - Joxon - 08-18-2015 So, I won't be including SpaceHamster like I intended. This'll be a game based mainly around PBG. So... Does anyone have a good editable Zelda based heart system and RPG text box system? RE: PBG's ADVENTURE! (Yeah!) - Joxon - 08-29-2015 So... I need help with the health system. It's gonna be a Zelda like health system. I have the variables down, but I'm not sure how to actually draw the hearts. In specific: -Drawing the amount of hearts PBG has -making a new row every 10 hearts......- Well, if you played Zelda, you know what I'm going for. I'd love some help making this code. RE: PBG's ADVENTURE! (Yeah!) - TheShyGuy - 08-29-2015 Are you unsure of of to set up the code for a health system, or just specifically rendering hearts appropriately? How do you track the current health? Since each heart has a smallest value of 1/4, you can use integers to represent health. For every 4 whole numbers, you have 1 whole heart. Doing this makes it easier to render than using decimal numeric types and comparing decimal values like .25, .5, .75, etc. You can use the % (remainder) operator like so: wholeHearts = totalHealth / 4; //integer math, so 3/4 = 0 whole hearts. fractionalHearts = totalhealth % 4; //Ex) 5 % 4 = 1, 4 % 4 = 0, 3 % 4 = 3 For the fractionalHearts, you render whatever sprite represents the fraction, 1 -> 1/4, 2 -> 1/2, 3 -> 3/4. To render new rows of hearts, you can probably iterate over all your hearts when rendering while tracking the total. If the total is greater than the max row size, then you reset the render position and offset in the YAxis. RE: PBG's ADVENTURE! (Yeah!) - Joxon - 08-29-2015 :p Welp, I shoulda mentioned that I'm not using half and quarter hearts... I wasn't planning on needing half hearts. I'd just prefer it slightly simpler. Each heart is a hit basically. I don't think any attacks would take more than 3 hearts. Anyways, I need help rendering the hearts. I keep track of it using two variables: hp and maxhp, both set as global variables. Obviously collecting a heart container adds to maxhp by one. It's "simple". I need code that'll render the total amount of hearts, which hearts are empty, and it to render a new row every 10 hearts Thanks to anyone that helps! RE: PBG's ADVENTURE! (Yeah!) - TheShyGuy - 08-29-2015 I was gonna explain it, but this little section of code should show a solution much quicker: Code: //I assume that hp and maxhp are whole integer values and that each of these variables are defined RE: PBG's ADVENTURE! (Yeah!) - Joxon - 08-30-2015 Now, are any of those functions that aren't supported by GameMaker 8.0...? Another thing i shoulda mentioned earlier... RE: PBG's ADVENTURE! (Yeah!) - TheShyGuy - 08-30-2015 Oh yeah, they're just psuedo functions. Look at the overarching idea. You determine the XY location of each heart by using it's index. The way its calculated causes hearts to begin a new row every 10 hearts, full or empty. After you find the location, you just use whatever GM function you know of to render the appropriate sprite. RE: PBG's ADVENTURE! (Yeah!) - Joxon - 08-30-2015 Alright... What's the Short function for? That was my main concern. RE: PBG's ADVENTURE! (Yeah!) - TheShyGuy - 08-30-2015 The only function is "RenderSprite(...)". The rest of the names are just integers. RE: PBG's ADVENTURE! (Yeah!) - Joxon - 08-30-2015 Ok, so, what is the reasoning for listing the variables at the top after the word "short"? Code: short hp, maxhp, maxHeartsPerRow, i; Is this setting variables or...? Also, what would I replace cellX/cellY, cellPixelWidth/height with? Or should I replace them at all? RE: PBG's ADVENTURE! (Yeah!) - TheShyGuy - 08-30-2015 Declaring the variables in a list like that only shows that the following variables are all of the same type. Code: //I assume that hp and maxhp are whole integer values and that each of these variables are defined RE: PBG's ADVENTURE! (Yeah!) - Joxon - 08-30-2015 Dammit, I updated my post after you post a reply to it. Fortunately you answered the question anyways. Alright, thanks for clearing that up! EDIT: One last thing, whats the % for? RE: PBG's ADVENTURE! (Yeah!) - TheShyGuy - 08-30-2015 It's the remainder operator. It's the value that you would get after long division and getting a remainder. So: 7 % 3 = 1 6 % 3 = 0 (no remainder from 6 / 3) 5 % 3 = 2 4 % 3 = 1 3 % 3 = 0 2 % 3 = 2 1 % 3 = 1 0 % 3 = 0 ___ I'll make something real quick to show how it's used to find cellX. RE: PBG's ADVENTURE! (Yeah!) - Joxon - 08-30-2015 Well, the problem is, i don't believe there's anything with that function in GameMaker. |