PBG Engine - 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 Engine (/thread-26207.html) |
PBG Engine - Joxon - 11-16-2014 LATEST BUIL https://www.dropbox.com/s/wr0uonc71ykwrkj/PeanutButterGame%20BETA.exe?dl=0 A little game engine demo for a possible PBG game. Thoughts? Glitches? It's just the basic engine so don't expect anything unique yet. Note that nothing in this is final. Sprite Thread: http://www.vg-resource.com/thread-26110.html RE: PBG Engine - Kelvin - 11-17-2014 For some reason, you jump higher when moving than when standing. I'm guessing this is meant to be a result of getting a running start, like in Jazz Jackrabbit, but since your movement speed is absolute and doesn't use momentum/acceleration, you could just as easily quickly tap left/right near an edge and then jump, so you might as well just give the player the full jumping height anyway. Also, is it just me, or do hearts respawn? RE: PBG Engine - Joxon - 11-17-2014 Yeah hearts respawn. It's just for this though since it's just a test level. Also, That gives me the idea to add acceleration... I'm gonna get on that. RE: PBG Engine - Joxon - 11-18-2014 https://www.dropbox.com/s/xwklns11htgmwaw/The%20PeanutButterGame.exe?dl=0 Now with a WIP custom tile set. No acceleration because I couldn't get it to work right. RE: PBG Engine - Kelvin - 11-21-2014 Create Event Code: xSpeed = 0; Step Event Code: if(xSpeed > 0 && (!place_free(x, y + 1) || hitFloor(x, y + 2))) xSpeed -= 0.5; //If xSpeed is greater than 0, lower it. "move" Script Code: /*First we get a couple variables. "hitFloor" Script Code: if(instance_exists(Floor)){ The Floor object is the type of platform you can pass through. The height of the Floor's sprite does not matter, since this script checks if the sprite is above and only above the Floor. If you're using collision masks, it may be wise to substitute sprite height for the sprite's bounding box's lower edge. Hope that solves your physics problems. Let me know if you have any trouble, and I'll see if I can fix it. [EDIT AFTER PLAYING NEW BUILD] I've noticed a few issues. One, when you get hurt, you always get pushed to the right. When mixed with walking, you can move right very fast. You should set it to push against the player's current direction, which I keep track of using a variable called "facing" which is 1 for right and -1 for left. Not only does this give me something to multiply the knockback speed by, but I can also multiply the image_xscale of the player by that so I don't have to make left-facing sprites. Two, when you die, the camera just goes off and freezes for a second, and it made me think I broke the game. RE: PBG Engine - Joxon - 11-21-2014 New version: https://www.dropbox.com/s/xwklns11htgmwaw/The%20PeanutButterGame.exe?dl=0 Yeah those are some glitches that I just fixed. Also the if you look at the sprite thread, you'll notice that the right and left sprites are now different. One problem, when you get hit in the back, you fly into the enemy. Any tips on how to fix that? Also I'm not using coding, I'm using the GameMaker premade... Things I guess... That you drag into an event. So perhaps, if possible, you could build an extention for any codes?Only if you want. And the death thing was fixed. For some reason that just started happening when ever you died. I didn't even edit anything in the dying event. Idk what happened oh well. RE: PBG Engine - Kelvin - 11-22-2014 You don't need an extension, just put the code I gave you into a code action. It'll work just fine. I dunno why you're using the action icons anyway; they only slow down editing events. As for the knockback, this is what I use: Code: if(state != hurt && !blinking && !attacking && other.state != hurt){ //This is just to make sure the player can be hurt. Chance it to whatever you need. I removed the code involving state and sprite changes, because I don't know what you're using. Anyway, this code will check which side of the player the enemy is on, and then knock them in the opposite direction. RE: PBG Engine - Joxon - 11-22-2014 One: I'm using two separate sprites for left and right. Two: I'm using action icons because I don't know coding that well... Three: I can just copy this code in to the event too, right? RE: PBG Engine - Kelvin - 11-22-2014 One: You can still use a facing variable to keep track of what side your character is facing. That'll simplify a lot of things. Rather than checking every possible sprite when checking where the player is looking, you can just use facing. Two: The action icons mimic coding, only using pictures instead of words. The coding language is very easy to learn, and can do things that icons can't, plus it's a lot faster to type things in than having to flip through pages for an icon each time you want to use it. Three: Under the control tab in the actions library, you'll find an icon for "execute a piece of code". Put the code in there. RE: PBG Engine - Joxon - 11-23-2014 The code doesn't work... It says variable state unknown. Edit: fixed with action icons. Also what do you mean by sprites bounding box lower edge? RE: PBG Engine - Kelvin - 11-24-2014 That's because you aren't using states. I forgot to remove that part. As for the sprite's bounding box, there are functions for that if you'll look in the code reference in the help file. There are no action icons for it though; you need to learn SOME code, otherwise you're limiting yourself. Converting my code into icons is just gonna make it even harder to edit. Seriously, man, you gotta get off the icons; they're holding you back. RE: PBG Engine - Joxon - 11-25-2014 Good news! I'm learning code! I've coded the step and floor events so far. I have one problem with moving though, how do you set a variable to reletive? RE: PBG Engine - Kelvin - 11-27-2014 You don't. That's only for icons. In order to change a variable by a relative value in code, instead of doing something like v = 8, you'd do v += 8. You could also do v = v + 8, but that's just extra typing and only exists because older languages didn't support +=. The relative option in the icons is just asking if you wanna use += instead of =. It's a bit misleading, if you ask me, because I found myself asking the same question when I started coding. RE: PBG Engine - Joxon - 11-27-2014 Okay, but what about (x,y)? For example, if (place_free(-5,0))? RE: PBG Engine - Kelvin - 11-28-2014 For that, you'd do place_free(x - 5, y). |