[ZScript] Side Scroller Game Starter Kit

Post your example zscripts/ACS scripts/etc here.

Re: [ZScript] Side Scroller Game Starter Kit

Postby SuperSomariDX » Sun Mar 05, 2017 10:01 am

This is looking nice, Nash! Will definitely look into learning how to use this!
User avatar
SuperSomariDX
wonders what the hell is a Horror Monitor.
 
Joined: 01 Jul 2014
Location: Stuck in Illbleed once more.

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Sun Mar 05, 2017 10:14 am

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
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [ZScript] Side Scroller Game Starter Kit

Postby YukiHerz » Sun Mar 05, 2017 10:22 am

Hmm, my brain made me skip that one bit of text :p.
User avatar
YukiHerz
Cheap Spaghetti Dude
 
Joined: 02 Dec 2013
Location: Why tho.

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Wed Mar 08, 2017 8:50 am

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
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [ZScript] Side Scroller Game Starter Kit

Postby Oberron » Fri Mar 10, 2017 7:33 am

I'm gonna make a side-scroller similar to The Terminator on the Genesis/Megadrive if I can rip the sprites.
User avatar
Oberron
After hours.
 
Joined: 02 Aug 2015
Location: Neptunia (Czech Republic)
Discord: BlaringCoder395#1725
Twitch ID: Adam_Deme

Re: [ZScript] Side Scroller Game Starter Kit

Postby Agentbromsnor » Mon Mar 13, 2017 10:21 am

Just leaving a message to say that I'm using this as a ZScript reference. Thanks. :)
User avatar
Agentbromsnor
 
Joined: 28 Mar 2012

Re: [ZScript] Side Scroller Game Starter Kit

Postby Ozymandias81 » Tue Mar 14, 2017 10:24 am

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 42 times

I have managed to retrieve and pack these from here. :D
User avatar
Ozymandias81
Doom is a State of Mind... Out of Control.
 
Joined: 04 Jul 2013
Location: Mount Olympus, Mars

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Tue Mar 14, 2017 10:57 am

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.
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [ZScript] Side Scroller Game Starter Kit

Postby blood » Tue Mar 14, 2017 11:26 am

Excellent!
blood
 
Joined: 25 Aug 2011

Re: [ZScript] Side Scroller Game Starter Kit

Postby Death Egg » Thu Mar 23, 2017 12:56 pm

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
Death Egg
 
Joined: 14 Aug 2012

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Thu Mar 23, 2017 5:53 pm

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
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [ZScript] Side Scroller Game Starter Kit

Postby Death Egg » Sat Apr 01, 2017 4:54 pm

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
Death Egg
 
Joined: 14 Aug 2012

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Sat Apr 01, 2017 8:24 pm

Sure, I guess I can plop in a simple enemy that moves back and forwards or something.
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [ZScript] Side Scroller Game Starter Kit

Postby Death Egg » Sat Apr 01, 2017 9:33 pm

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 allExpand view
// 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
Death Egg
 
Joined: 14 Aug 2012

Re: [ZScript] Side Scroller Game Starter Kit

Postby Nash » Sun Apr 02, 2017 12:31 am

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.
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

PreviousNext

Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest