[ZScript] Side Scroller Game Starter Kit

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
SuperSomariDX
Posts: 185
Joined: Tue Jul 01, 2014 10:44 am
Location: Stuck in Illbleed once more.

Re: [ZScript] Side Scroller Game Starter Kit

Post by SuperSomariDX »

This is looking nice, Nash! Will definitely look into learning how to use this!
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [ZScript] Side Scroller Game Starter Kit

Post by Nash »

YukiHerz wrote:if you spam the jump button/press it at the right time, you can continuously jump mid-air.
Yeah, it's already written in the OP... it's a simple oversight. I've already fixed it. I'm also looking at making the player movement more tweak-friendly so you can customize the platforming "physics" to better suit your type of game (you will be able to adjust the movement from slidey Mario, to tight-as-f$@k Symphony of the Night)

I'll also add crouching and jump-through platforms but that's about it.

I probably won't add much else though because I cannot assume what kind of platform game anyone would want to make. There's too many possibilities. I'm not going to write peoples' games for them. =P
User avatar
YukiHerz
Global Moderator
Posts: 1503
Joined: Mon Dec 02, 2013 6:01 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Where corruption is redefined daily.

Re: [ZScript] Side Scroller Game Starter Kit

Post by YukiHerz »

Hmm, my brain made me skip that one bit of text :p.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [ZScript] Side Scroller Game Starter Kit

Post by Nash »

8 March 2017 update:

- Added ZScript versioning compatibility (requires GZDoom g2.4pre-820-ge5a3d22 now)
- Added player acceleration and deceleration to control the tightness of the player movement.
- Added dynamic jump height. Hold the jump key to jump higher. Tap the jump key to do short jumps.
- Added crouching.
- Fixed infinitely-jumping bug.
- Made demo map a little bigger.

The player movement properties can be customized in zscript/SideScrollerGame.zsc

Notice: I will no longer upload attachments to the forum, to conserve web space. To grab the latest version of the SDK, just go to the Github page, click the large green button that says "Clone or download", then "Download ZIP".

I plan to add a few more basic functionality before declaring this SDK final:

- Jump through platforms
- Pain and death state
- A simple attack animation
- Moving platforms
User avatar
Oberron
Posts: 1048
Joined: Sun Aug 02, 2015 1:20 am
Graphics Processor: ATI/AMD (Modern GZDoom)
Location: Czech Republic
Contact:

Re: [ZScript] Side Scroller Game Starter Kit

Post by Oberron »

I'm gonna make a side-scroller similar to The Terminator on the Genesis/Megadrive if I can rip the sprites.
User avatar
Agentbromsnor
Posts: 265
Joined: Wed Mar 28, 2012 2:27 am

Re: [ZScript] Side Scroller Game Starter Kit

Post by Agentbromsnor »

Just leaving a message to say that I'm using this as a ZScript reference. Thanks. :)
User avatar
Ozymandias81
Posts: 2062
Joined: Thu Jul 04, 2013 8:01 am
Graphics Processor: nVidia with Vulkan support
Location: Mount Olympus, Mars
Contact:

Re: [ZScript] Side Scroller Game Starter Kit

Post by Ozymandias81 »

This is awesome... Gonna check it while I can.

Meanwhile, if any of you are interested to port Prince of Persia on GZDoom, here you are all graphical elements from the game:
PoP.7z
Prince of Persia graphics resources
(142.13 KiB) Downloaded 152 times
I have managed to retrieve and pack these from here. :D
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [ZScript] Side Scroller Game Starter Kit

Post by Nash »

Making a Prince of Persia-style platform movement will be a little complicated. The Prince's movement is restricted to tiles, so some additional work will be needed to make sure the player's movement adheres to those tiles. The Prince also has a lot of smooth animations (very impressive for the 90's) so obviously a lot more code is needed to make the Prince play all those animations.
blood
Posts: 134
Joined: Thu Aug 25, 2011 3:17 pm

Re: [ZScript] Side Scroller Game Starter Kit

Post by blood »

Excellent!
User avatar
Death Egg
Posts: 198
Joined: Tue Aug 14, 2012 10:16 pm

Re: [ZScript] Side Scroller Game Starter Kit

Post by Death Egg »

This is probably an odd request, but is there any way you could add functionality to switch between this and normal, first person gameplay mid-level, kind of like how SRB2 can switch between 2D and 3D gameplay on a whim?
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [ZScript] Side Scroller Game Starter Kit

Post by Nash »

It's definitely possible to add that functionality, but it's beyond the scope of a basic game kit. The purpose of this kit is to cater solely to typical side scrollers only...
User avatar
Death Egg
Posts: 198
Joined: Tue Aug 14, 2012 10:16 pm

Re: [ZScript] Side Scroller Game Starter Kit

Post by Death Egg »

Will you be including basic enemy AI in future releases? I'm really loving the current version by the way, it's inspired me to finally work on learning coding properly and begin work on rebooting a game I've worked on and off on for 16 (!) years.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [ZScript] Side Scroller Game Starter Kit

Post by Nash »

Sure, I guess I can plop in a simple enemy that moves back and forwards or something.
User avatar
Death Egg
Posts: 198
Joined: Tue Aug 14, 2012 10:16 pm

Re: [ZScript] Side Scroller Game Starter Kit

Post by Death Egg »

I have this code for my project that I accidentally fucked up. I was trying to implement friction and braking as in this guide, the friction worked but the braking kept giving me problems. No matter how much I reformat it, it still throws the player to either the left with an insane velocity or to the right. I am really new to this coding stuff so I've been trying to avoid getting help for all the other bugs, but this one is really kicking my ass.

Code: Select all

// apply X velocity
		if (sideInput != 0) //if there is input
		{
			if (vx >= 0 && sideInput > 0) vx += PLAYER_ACCELERATE; //if velocity is above 0 & pressing right, add acc
			else if (vx <= 0 && sideInput < 0) vx -= PLAYER_ACCELERATE; //if velocity is below 0 & pressing left, sub acc
			vx = Clamp(vx, -SideMove1, SideMove1); //velocity = Limit(Velocity,input left, input right)
		}
		else if (sideInput == 0 && vx != 0) //if there's no input and velocity isn't 0
		{
			if (dir == DIR_Left) vx += (PLAYER_FRICTION * vx); //if facing left, add friction 
			else if (dir == DIR_Right) vx -= (PLAYER_FRICTION * vx); //if facing right, sub friction
		}
		else if (sideInput == 0 && vx == 0) //if there's no input and velocity is 0
		{
			vx *= PLAYER_FRICTION; //Velocity = Velocoity * Friction
		}

		// braking
		if (sideInput != 0 && vx != 0) //if there's no input and velocity isn't 0
		{
			if (vx < 0 && sideInput > 0) vx += PLAYER_DECELERATE; //if velocity lower than 0 & facing right, add decelleration
			else if (vx > 0 && sideInput < 0) vx -= PLAYER_DECELERATE; //if velocity is above 0 & facing left, sub decelleration
		}
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [ZScript] Side Scroller Game Starter Kit

Post by Nash »

Just a wild guess: in the braking part, what happens if you do vx *= PLAYER_DECELERATE; ? I don't understand what's going on but if you say your character is being thrown off very far, it could be because you're adding velocities in the braking part.

Disclaimer: I have no idea what's going on and I'm not familiar with Sonic's movement physics so it could be that my response is waaaay off.
Post Reply

Return to “Script Library”