Block Breaker Enemies

Hello All,

I have something playing on my mind and I am hoping that you or a group of you might be able to help.

After actually spending some time with the original Arkanoid game I noticed something that I had completely forgotten about. And it’s those weird looking enemies that come out of the top of the screen and eventually make their way down to the bottom of the screen where they either pass through the bottom of the screen or get destroyed on the way down.

So, as an exercise mainly intellectual and getting information on what I might need to do, I have been playing around with the idea of how I might implement those things at some future date because I really need to move on with the course.

This is what I have come up with so far:

There are a maximum of 3 “enemies”, all of the same type, that can be seen in any stage - well, from what I could see there are 3. So, I was thinking of setting up an enemies class with a linkage to a prefab that contains the animation file. Somewhere else in the code call an array of 3 objects calling the Enemy class: Enemy enemy [3]; with methods for dealing with the state, and movement and others.

The first thing is that these enemies seem to start either by the amount of blocks or by the amount of time the game the stage has been running for. Now I don’t know anything about creating a timer in Unity, I have done it in Java and Flash before but it was eons ago. So using the number of blocks destroyed might be a good start. So as the number of blocks decreases to about a 3/4 have the first enemy become active - then 1/2 then 1/4. For example, if 1/2 blocks remain numEnemies++;

If the enemy get hit by the ball or bat/paddle/ship respawn it - but without actually destroying the game object because that would cause all sorts of problems with null objects, use a prefab explosion to make it look like it’s destroyed, just deactivate it using a boolean variable and then put it at some random place at the top of the screen - because goodness only knows how to make that animation at the top of the screen at two different places and make the enemy move down it. So sort of this:
for(i = zippola, i<numEnemies, i++)
if (enemy[i].GetState is false) then respawn() else MoveEnemy().

The next thing has me baffled how on earth do you make the enemy move down the screen in a seemingly random way like they did it. I need to learn a lot more about this! It’s sort of like Pathfinding but not quite, but, in the case of the Red enemy - the morphing cube/sphere it IS pathfinding - which actually quite scary in a game this old.

So, what else do i need to include to get it more concrete in my head? Is deactivating the gameObject the way to go or do I actually need to destroy it and find a way to deal with the null objects? Pathfinding or enemy pattern movement?

1 Like

Wow, nice implementation you are up to do right there, this is a good thing, keep going. :slight_smile:

Well, I would do it a little differently to be honest. I would create one prefab containing an GameObject that controls the animation, it would have one script and would be parent of another GameObject with the sprites of the meteor so it can animate things separately to the child (I will call it meteor as I pictured it that way :joy:). After that I would create a controller for this kind of enemy that will be responsible for spawning it and keep count of how many there is, and also to keep track of how many blocka has been destroyed etc. this way would be easier to keep track of everything.
You can keep track of the time with Time.time or Time.timeSinceLevelLoad, to count it just store the value of either on a float when you want to start to count and then you can compare it to Time.time or Time.timeSinceLevelLoad depending on which you used (it will give you the amount of time that has passed since you stored the float). But if you want to run something after x seconds has passed, the best method that I know of is to use a Coroutine and a IEnumerator with “yield return new WaitForSeconds(x)”, it is a very powerful tool.
I don’t see why would destroy those new enemies make something return a null reference in this way, I have never use a pathfinder before, so I don’t have a clue about how I would do it, but if you want it to always move in the y direction, you wouldn’t need to use it either.

Well, that is how I would do it, but probably other users will come up with better solutions. Sorry about any misspellings, I’m using my mobile here

1 Like

Firstly, this sounds fantastic, not least of which is the research into the original Arkanoid game. I have a version of it on my son’s XBox and it’s about right but has a few minor differences. It does however have the aliens that you mention.

Putting the technical stuff to one side for a moment, when the ball hits the aliens it also rebounds, something to consider - this is their main point of being in the game, as they dont actually cause any damage to the player (the bat) - at least not in the XBox version anyway. The aliens also bounce off of the blocks, slowly manoeuvring their way downwards. One of the alien types on the XBox version (a set of what look to be 3 or 4 orbs stuck together) actually cause damage to blocks when they take their first hit to separate them.

They can also be shot if you have laser.

Now… regarding you post in more detail… :slight_smile:

Stop adding awesome new features all the time then! :smiley:

Of course, where’s the fun in that… but I understand your desire to move on through the course. If you don’t implement these features yet, just be sure to have a clean working copy of your game at this time and keep a really good log of the features (and any potential defects) before you move on - this will make it a lot easier when you return to it later :slight_smile:

I don’t recall exactly where Ben refers to the MVP - Minimum Viable Product - but that would be a good way to approach this feature. You have outline what the original did and how it functioned and what it needs to do and woooaaah, so many things! So, what’s the least it could do to get it started?

  • Do you need fancy sliding doors opening at the top of the level? (XBox version has a number of places on the side walls too for this)
  • Do the aliens need to animate?
  • Do the aliens need pathfinding to home in towards the player?
  • Do the aliens need to cause damage to blocks?
  • Do the aliens need to rebound the ball?
  • Do the aliens need to create a particle effect when destroyed?

My point here is one of taking a feature and breaking it down into many smaller features. Then, start with the most simple of things to start the whole thing off.

Phase 1

  • use a simple/basic/plain sprite
    a simple shape would do, maybe a circle, in one colour
  • spawn an alien
    perhaps on a key press initially just so you can add some whilst play testing
  • limit the number that can be spawned
    perhaps have this as a configurable variable
  • keep track of the number of spawn aliens
  • keep the game running as it did before with all of the above new stuff implemented

Phase 2

  • destroy an alien
    again with a key press perhaps
  • update the number of spawned aliens

You can now add and remove aliens on key presses in your game. Which, importantly, still works. Sure they don’t really do anything yet but you can start ticking off those smaller features which is hugely beneficial for a feel good
factor, and enables you to make iterative progress carefully, rather than jumping right in and worrying about screwing the whole project up :slight_smile:

The above are just examples, but are fairly small. You could also for example add the particle effects to Phase 2. Now you can add / remove aliens and it looks pretty (ish).

Gradually add each additional small feature to the bigger feature. As mentioned before, if you’re not using source control yet, do, you could create separate branches for functionality you want to test, like for example the pathfinding. If it all goes horribly wrong, no problem, just grab a copy of the source again pre-changes :slight_smile:

If you wanted to go a step further (as I would) you may want to list all of the smaller features and then score them. Scrum, if you are not familiar has a method for this which involves giving these features a value, such as “story points”, effectively a number which represents the challenge/effort required of the item. So, to just spawn an alien within the scene on a key press may perhaps represent a value of 1. This doesn’t mean 1 day, or 1 week, or 1 unit of development, but for you you know its something that now doesn’t represent a significant challenge.

Now, if you consider the pathfinding, if at the moment you don’t know anything / much about that (or which ever feature is the more daunting), if it’s something entirely new which may involve creating a separate little mini project to test a few things out and so on, that sounds quite a lot bigger, so maybe you score that 100. You are indicating that this is going to need some serious thought, work, and invariably perhaps duration.

Once you’ve scored all of the mini features you can then reflect on your list and decide which ones you can implement fairly easily and swiftly. It’s worth revisiting the scoring incidentally. Chances are as the days/weeks go by you will start to read up on various techniques for some of the other features and maybe what was a 100 previously becomes a 40 because you have found a really good tutorial that fits perfectly or you had that flash of inspiration in the bath - whatever the cause, re-evaluating the scores of the features can be beneficial so you don’t always assume that the 100 (maybe deemed worst) item is always last. Maybe you just set aside some additional time to tackle that bad boy for the next couple of weeks.

The development phases are typically referred to as sprints incidentally, but I left it as Phase 1 and Phase 2 at the top as I’d not mentioned Scrum at that point :slight_smile:

Sorry about the length of the post, but I just wanted to circle back to the MVP. Little successes frequently will be very rewarding and are much more likely to keep your motivation high and as such, make the harder tasks easier to resolve.

I hope this is of some use, if nothing else, maybe to make you tired for a good night’s sleep! :smiley:

1 Like

Just to let you know I have read both your replies and they were both very helpful. @Joao_Dalvi that information about using the time will come in extremely useful moving down the track. And as always @Rob your ideas on Game Design and Programming insights are particularly valuable. Those MVP and Scrum concepts are things that I will implement right now!

@Rob would you be able to tell me what Source Control client that you use? Is it PlasticSCM, Perforce or do you use some external program like SourceTree and BitBucket?

I will say this though: Do the Aliens need to animate? Well, that’s already done. If you have a sprite sheet Unity makes that feature so simple, it always bring a smile to my face :relaxed:. There is no coding necessary and no playing around in the Animator, key frames and transitions. Occasionally the results aren’t always as expected, but, I not going to complain :grinning:. Oh, and it did give me a good nights sleep :stuck_out_tongue:.

Now, if I sound a little flat in my response it’s because I am - I got some news last night that took all the wind out of my sail - it’s not bad news per se, but, it has rattled me nonetheless.

1 Like

Okay, I’ve been looking into how I might use a Controller type thingy without using array, which I used a lot in C type programming and I thought I was making some headway. Now I put the controller on the actual prefab hopefully negating the need for arrays.

I used the LevelManager to store the value of the enemies because it is … well, a Level manager and was using it to Spawn the enemies. All seemed to be going well. It Spawned an enemy put it around where I wanted to somewhat random. And then I came to detecting a collision with the ball in the OnEnterCollision2D in the controller and that is were it all went haywire. It was registering a collision every 5 seconds or so regardless of whether there was an enemy spawned or not, and I can’t figure out why? It seems to be registering a collision between the paddle and the ball???

The code of the EnemyController is as bellow:

using UnityEngine;
using System.Collections;

public class EnemyController : MonoBehaviour {

//initialization stuff
private LevelManager lm;

//access the prefab
public GameObject enemyPrefab;
private GameObject clone;

Vector3 randomPos;


//initialize values on Start
void Start () {
	print ("We are in Enemy Controller");
	lm = GameObject.FindObjectOfType<LevelManager> ();
	int getCount = lm.getEnemyCount ();
	print ("Num Enemies: " + lm.getEnemyCount ());

}	


/// <summary>
/// Update is Empty at this time
/// </summary>
// Update is called once per frame
void Update () {

}//end Update()



/// <summary>
/// Sets the random value of clone object in the x position.
/// </summary>
public void setRandomValue(){
	randomPos.y = 11;
	randomPos.z = 0;
	randomPos.x = Random.Range (1f,15f);

}//end setRandomValue 

/// <summary>
/// Spawn an Ememy	
/// </summary>
public void SpawnEnemy(){
	print ("SpawnEnemy");
	setRandomValue ();
	clone = (GameObject)Instantiate (enemyPrefab, randomPos, Quaternion.identity); 

}//end SpawnEnemy()


void OnCollisionEnter2D(Collision2D col){
	//gameOject name = bBall WTH!!!!!!!!!!!!!!!!!
	print ("col:"+ col.gameObject.name);
    }
}//--> End Enemy controller

Now if anyone can tell me what is wrong with the code and/or functioning the way it is then please, please tell me so I can try and fix this problem. Any help is greatly appreciated.

Regards,
Vaughan.

1 Like

Hey @Vaughan_MacEgan,

Firstly, my apologies, it would seem I missed your previous post!

Currently I am giving GitKraken a trial. It’s free for the non-pro version and appears to be working well. It has easy configuration for GitHub and BitBucket and is graphically very pleasing.

To the problem in hand…

First question I suppose is about the attachment of your EnemyController. You mention that you put it on the actual prefab, do you mean the enemy prefab, or another one that you have for the enemy controller? The reason I ask is that it sounds a little bit cyclic if it’s on the enemy prefab, e.g. you attach the enemy controller script to the enemy prefab and then pass in a reference to the enemy prefab in the public enemyPrefab field, which in turn would have a reference to the script and… my brain hurts :slight_smile:

If this is the case I would perhaps try creating a simple game object in the hierarchy called EnemyController and attach your EnemyController script to that, then, drag you Enemy prefab to the enemyPrefab field in the script. Give it another run and see what happens.

Sorry again for missing your previous post and sorry to hear you had some bad news.

If you think your brain hurts, it’s nothing compared to mine :confounded: :scream: :anguished:. With regards to Unity and multiples of anything, Unity is doing everything different to the way I’ve done everything in the past ie without arrays. And I almost blew a gasket when I realized out that EVERY brick in the Game HAD a script attached to it.

1 Like

hehe… but you can obvious dial down the repetitiveness, and I’m not suggesting this is the time to implement it, but you could have a script on the brick which just calls methods in a controller script, so that anything clever that the brick needs to do isn’t duplicated again and again and again… but as I said, this maybe isn’t the time to start refactoring until you have the other issue resolved and really, at this stage isn’t going to hurt to much if you didn’t. The fact that you know that they all have the same script and the same code duplicated is more beneficial I would suggest :slight_smile:

Right, that sorted out that problem, no more registering that the is ball colliding with the paddle! And trying the delete the paddle gameObject. And the collision with the Ball results in a the Destroy gameObject being registered, so, that’s a big success …well, I’m claiming it as a big success! Thank you again o’ guru :grinning:.

I’ll have to keep in mind to do it that way from now:

  1. put an object in the Hierarchy
  2. add script.
  3. link to enemy prefab
  4. initiate the prefab in code
    [EDIT] 5. Grab everything and put it into the Prefab folder for other scenes - future reference

Next … linking up a collision with the lasers using EnterTrigger2D … then watch more of my hair turn grey :grinning:.

And I just spoke the name of the SCM software out loud GitKraken … and burst out laughing that’s hilarious :laughing:.

1 Like

Glad that worked :slight_smile:

Incidentally, once you have created that EnemyController game object and dropped the script on it, and popped the Enemy prefab into that - you can then drag that whole EnemyController into the Assets / Prefabs folder so that you can simply drag it out onto your next scene etc :slight_smile: If you make any changes, just be aware you want them to be reflected through the prefab, not on the individual instances in each scene :slight_smile:

Two more recommended tools for the developer…

I chose the latter :slight_smile:

1 Like

Ok, I am having some problems with this EnemyController Code. From the way it was functioning last night I figured that I might be on the right track. So today - it’s now 4.00 in the AM :weary: - I tried adding some movement into the ‘frenemies’. And after much trying code, I found that I could only have one of them moving, whereas, I was hoping to have all active frenemies moving toward the X position of the paddle at the top of the screen.

I am eager to learn what I am doing wrong and willing to scrap the code and start again, but I need to know what I am doing wrong with this code first!

The code is pasted below:

using UnityEngine;
using System.Collections;

public class EnemyController : MonoBehaviour {

	// Use this for initialization
	private LevelManager lm;

	//access the prefab
	public GameObject enemyPrefab;
	private GameObject enemyObj;
	
	Vector3 randomPos;

	//need this to find position of enemy?!?
	private Transform enemyPos;
	private PaddleMove myBat;
	
	Vector3 ePos;			//to vector values of enemy

	/// <summary>
	/// Start this instance.
	/// </summary>
	void Start () {
		print ("We are in Enemy Controller");
		lm = GameObject.FindObjectOfType<LevelManager> ();
		int getCount = lm.getEnemyCount ();
		print ("Num Enemies: " + lm.getEnemyCount ());

		myBat = GameObject.FindObjectOfType<PaddleMove> ();
		//print ("The Bat postion: " + myBat.transform.position.x);
	}	

	/// <summary>
	/// Update is Empty at this time
	/// </summary>
	// Update is called once per frame
	void Update () {
	
		//code pulled in from LevelManger to see if behavoiur changed
		// it did slightly the nasty code for getting the enemy position
		// could be commented out and simplified but only the last 
		// 'frenemy' moved - but with the code removed and the 
		// nasty code being reintroduced only first 'frenemy' worked
		if (Input.GetKeyDown (KeyCode.UpArrow)) 
		{
			lm.setEnemyCount();
			print ("Call to SpawnEnemy...");
			SpawnEnemy();	
		}

		//yes this performs an ugly error if all the instantiated object
		//gets destroyed as I am not taking into the account the objects being 
		//destroyed and enemyCount ending back at 0.
		if (lm.getEnemyCount() > 0) 
		{
			//this is where it gets really problematic!
			//As is only last object moves whereas I am trying to get all 
			//the objects moving and hopefully crashing into one another :)
			//Unity doesn't seem to know where the enemy is even
			//though it was instatiated earlier in spawnEnemy
			//without the code above pulled in from LevelManager above
			//the nasty code below was needed to get the enemy position:
			//	enemyPos= GameObject.FindGameObjectWithTag ("new_enemy").transform;
			// 	ePos=enemyPos.transform.position;
		
			if(enemyObj.transform.position.x > myBat.transform.position.x)
			{
				//print ("go left");
				enemyObj.transform.Translate (Vector3.left * 3f * Time.deltaTime);
			}
			if(enemyObj.transform.position.x < myBat.transform.position.x)
			{
				//print ("go right");
				enemyObj.transform.Translate (Vector3.right * 3f * Time.deltaTime);
				
			}//*/

		}
		//*/
	}// end Update()


	/// <summary>
	/// Sets the random value of clone object in the x position.
	/// </summary>
	public void setRandomValue(){
		randomPos.y = 11;
		randomPos.z = 0;
		randomPos.x = Random.Range (1f,15f);

	}//end setRandomValue 

	/// <summary>
	/// Code was originally called by LevelManager
	/// now down within this class for testing purposes
	/// to get multiple obj's moving
	/// </summary>
	public void SpawnEnemy(){

		print ("SpawnEnemy");

		//lm = GameObject.FindObjectOfType<LevelManager> ();
		int getCount = lm.getEnemyCount ();
		print("Number of Enemies:..."+getCount);

		setRandomValue ();
		enemyObj = (GameObject)Instantiate (enemyPrefab, randomPos, Quaternion.identity); 

	}//end SpawnEnemy()

	/// <summary>
	/// For dealing with ball hitting the frenemies OnTriggerEnter2D needed for laser
	/// </summary>
	/// <param name="col">Col.</param>
	void OnCollisionEnter2D(Collision2D col){
		//gameOject name = bBall WTH!!!!!!!!!!!!!!!!!
		if (col.gameObject.name == "bBall") 
		{
			//print ("collision Detection...");
			Destroy(gameObject);	
		}
	}

}//--> End Enemy controller

The problem is that the variable enemyObj holds the reference of the last instantiated enemy only.

This is because of this line in SpawnEnemy():

When there’re no enemies instantiated in the Hierarchy, with this line you instantiate a new one and you have the reference to it in the enemyObj variable. So far, so good.
But, as soon as you instantiate a second one, enemyObj will hold the reference ONLY to this second one, and you’ll lose the reference to the first one (and so on when you instantiate a third, fourth, etc.).

Thus, in Update, you’ll only be able to move the last instantiated enemyPrefab.

To avoid this problem, you could use a List (which is basically an array with no fixed dimension), and every time you insantiate an enemyPrefab, you can add it to the List. And in Update() you can use a foreach loop to cycle through all the elements of the List and move all of them.

So, in order to fix it:

  • Add the namespace in order to use Lists, at the start of the script write:
  • Instead of private GameObject enemyObj; write:
  • In SpawnEnemy(), after SetRandomValue():

GameObject enemySpawned; enemySpawned = Instantiate(enemyPrefab, randomPos, Quaternion.identity); enemyObjs.Add(enemySpawned);

  • In Update(), after the if (lm.getEnemyCount() > 0):

foreach (GameObject enemy in enemyObjs) { if(enemy.transform.position.x > myBat.transform.position.x) { //print ("go left"); enemy.transform.Translate (Vector3.left * 3f * Time.deltaTime); } if(enemy.transform.position.x < myBat.transform.position.x) { //print ("go right"); enemy.transform.Translate (Vector3.right * 3f * Time.deltaTime); } }

1 Like

Morning Vaughan! :smiley: (welcome to my world!)

I think part of what makes this complicated is the structure of what is doing what. I’ve not looked at the code in detail yet, but at a glance it looks as if your EnemyController is a GameObject in the scene, responsible for spawning new enemies and moving them and checking for collisions between the enemies and other GameObjects. It is also grabbing a count of how many enemies there are in the scene from the LevelManager, who’s job is it to keep count of these enemies?

What I would consider is changing a bit of that complexity so that any specific/real issue can be more easily identified.

Suggeston…

  • Copy all code as is as a backup (I need to get in the habit of saying that more often before I suggest changes)
  • Move the variable/property responsible for keep count of the Enemies into the EnemyController, that is it’s job and it needs to stop be lazy!
  • Keep the Spawning method in the EnemyController, again, this should be deemed as it’s job
  • Move the code which actually moves the Enemy into a script and attach it to the actual Enemy prefab itself, it can be responsible for moving itself!
  • Move the code to detect collisions into the same Enemy script attached to the Enemy prefab, it should deal with collisions itself to!

For testing purposes you could leave your keypress code in the EnemyController for now.

Note, you may need to add a method call from the Enemy script to the EnemyController to say “erm, hey, I just crashed into something so you might want to reduce the count”

Think of your EnemyController as a bit of a factory/cookie cutter… it is there to simply produce more Enemies as required and keep a count of them (and probably some other cool stuff later too).

See if after a little rejig things work a bit more easily, I think your EnemyController is trying to do too much and has concerns for things it doesn’t need to. In the same way you have LevelManager to load new scenes, but you don’t move the ball around in there do you, or the paddle…

Hope this is of use :slight_smile:

1 Like

Using List’s, doh, of course. @Rob will shoot me for not at least thinking of that! What the hell was I doing. Well at early in the morning, I can do things I know about but not things I know very little about - that’s my excuse and I’m sticking to it :stuck_out_tongue:.

You see what I thought was happening with Unity was that an instance of the class Enemy Controller was being assigned to each of the created objects and so each had an Update function and each could go on moving their merry way - without any problem. I still have much to learn!

@Rob I think I might need to move on with the course because the stuff that I am having trouble with might be covered in the next section in “Laser Defender”. Keeping an eye-out for stuff to implement in “Block Breaker” and ALL the things you mentioned. I have a feeling that they might be covered.Just so you know I do “print” out the most important things in replies, so, I have a hard-copy and can refer to them again. You always come up with very important things so I look forward to your replies you give me MUCH to think about - you probably want to beat me around the head saying what the hell are you doing, but, I am learning … albeit slowly. When are you going to do your Unity Game Design course? You can use all my stupid questions as the basis - from basics, to all the bells and whistles.

After last night and a couple of incidents, I am going to implement Source Control Management. I made one change without keeping track of what it was and spent the next 2 hours trying to figure out what went wrong!

Now that’s a thought … I wonder what sort of problems I could create if I did that :joy:.

1 Like

It has taken me a while, as the weather here turned absolutely horrible, over the past week. The temperature was over the old century mark on the Fahrenheit scale, so, with martial arts taking up most of my free time I haven’t been able to work on the computer except late at night.

Anyway, I made the changes you specified and the collision detection between the enemyObjs and ball stopped working - I thought that it might, but, nothing I tried could get it back. It wouldn’t even register any collision at all :scream:. I tried looking for the collision between the ball and the enemy and that did work, with a caveat, if I hit the last spawned enemy and destroyed the enemy Unity threw an error:

MissingReferenceException: The object of type ‘GameObject’ has been destroyed but you are still trying to access it.Your script should either check if it is null or you should not destroy the object.EnemyController.Update () (at Assets/EnemyController.cs:76)

It was the line after the foreach statement - again, I can’t comprehend why. I mean the list should not be null. And I ran a check to see of the enemyCount is greater than zero!?!

So, this is beyond my skill. With the temperature being incredibly high and unable to stay in the computer room, and being constantly ******** from training/instructing I will have to leave this project at this point and maybe come back later if i learn the required things.

Thanks for your help - it was greatly appreciated :relaxed:.

1 Like

Maybe a little break from this one will be a good thing @Vaughan, you have done really well to not only get to where you needed to be in the course, but you have had the determination to expand on the course version of this game and turn it into something bigger - well done! :slight_smile:

If/when you want to return to this one, give us a shout, maybe post up the project so we can have a properly look and we’ll get you rolling with it again :slight_smile:

Look forward to seeing your laser defender soon! :slight_smile:

I think that you forgot to add, in OnCollisionEnter2D, the removal of the destroyed game object from the list, try to add this line after Destroy:

This way, you remove the reference to the destroyed game object from the list, avoiding the exception in the foreach (since it still tries to access a game object which doesn’t exist anymore).

1 Like

Yes, you are quite correct about the remove statement … but, the collision detection is on the ball item because the collision detection with the EnemyController is now kaput :cry:.

Like, I have this in the EnemyController:

OnCollisionEnter2D(Collision2D col){
print(“something hit me”);
}

and nothing ever registers, no tag objects or names nothing ever registers. I could try putting the remove line in the ball object and of course I will try it, but, I’m going to have to link up the ball object to the EnemyController as well. And as Rob points out this is getting objects interferring in things that they have no business being involved in. And as such needs quite an overhaul.

So, I’ll try the remove but I don’t think it will work correctly. But thankyou for the help you have given me. Using a list is something I wouldn’t have thought up on my own and it WILL come in handy down the line. So I have learnt something important even if I can’t use it yet. With the advice on time, Lists and Robs pointers on design I am learning some VERY valuable lessons that I never would’ve had not asking these questions!

[EDIT] I did get the code running albeit unsatisfactorily, a null value keeps getting thrown up for reasons I can’t fathom, but, I found a workaround. But with that and the collision code not working it’s now time to take a break from this and come back to it later when I know a little more - then redesign and rock the whole thing :guitar:.

Thanks to everyone who participated! It’s been really cool :sunglasses:.

2 Likes

At last - I figured out why the collision detection stopped working so now I have both Trigger and Collisions working. So, that is one problem solved - it wasn’t solved by doing Laser Defender, but, as a result at having a clear mind about this project.

1 Like