Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Thought I'd have a go with Unity a 500 character FPS!

A topic by Arowx created 16 days ago Views: 59 Replies: 1
Viewing posts 1 to 2
(1 edit) (+1)

Well I managed to get the simplest FPS to nearly be a playable game.

Basically zombies moving in on the player and old school raycasting as a gun (DOOM original version).


No crosshairs or bullet counters but a score, also no shot delay mechanic and the no game over state.

Code weighs in around 878 characters

public class K:M{T t;float s=30f;List<t> z=new List<t>();int u=0;public U w;
void Start(){t=transform;t.position=v(0,1.5f,0); T g=c(Q.Plane,V.zero,v(100,0,100));
for (int i=0;i<100;i++){V p=A.insideUnitSphere+A.onUnitSphere*50f;p.y=0f;
T x=c(Q.Cube,p,v(1,2,1));x.name="Z"+i;z.Add(x);}}T c(Q q,V p,V s){T n=G.CreatePrimitive(q).transform;
n.position=p;n.localScale=s;return n;}void Update(){float a=Time.deltaTime; float b=a*s;
t.Translate(v(i("H"),0,i("V"))*b);t.Rotate(v(0,i("X"),0)*b);V p=t.position;
foreach(T e in z){e.LookAt(p);e.Translate(V.forward*a);}
bool h=I.GetButton("F");R y=new R(p,t.forward);H j;List<t> d=new List<t>();
if(h&&P.Raycast(y,out j,100f)){T r=j.transform;if(r.name[0]=='Z'){d.Add(r);u+=10;}}
foreach(T f in d){z.Remove(f);G.Destroy(f.gameObject);}w.text="SCORE "+u;}
float i(string s){return I.GetAxis(s);}
V v(float x, float y, float z){return new V(x,y,z);}}

And that's with a lot of class name to character assignments and changes to the names of inputs.

//game expects to be on the default camera in a scene 
/* Need to rename Inputs   
* Horizontal to H  
* Vertical to V   
* Mouse X to X  
* Fire1 to F  
* w needs to link to a TextMeshProGUI label for the score  * 
*/  
using T = UnityEngine.Transform; 
using G = UnityEngine.GameObject; 
using V = UnityEngine.Vector3; 
using I = UnityEngine.Input; 
using R = UnityEngine.Ray; 
using H = UnityEngine.RaycastHit; 
using P = UnityEngine.Physics; 
using Q = UnityEngine.PrimitiveType; 
using A = UnityEngine.Random; 
using M = UnityEngine.MonoBehaviour; 
using U = TMPro.TextMeshProUGUI;

Unless I can find or figure out some other ways to reduce the size of the code base in C# or maybe write a wrapper API that does things via one character method calls not sure I could create an FPS in 500 characters in Unity.

The questing is should I submit this as an entry?

Host

Hey Arowx! I wouldn't suggest submitting if you can't hit the 500 character target, since that's the stated purpose of the jam.

However, something that I've done myself in the past if I'm at a wall and can't quite get an entry to 500 characters is to create a separate branch of the project, remove some behavior or objects, and submit the stripped-back version that hits the character limit. That way you can at least get your entry in (if it loads and is semi-playable, it's likely as sturdy as 50% of TTJ entries), but then you can take the larger base you built and run with it in other ways!

Hope that's helpful! And good luck!