Happy new year, and continued development!

Published January 02, 2019
Advertisement

It's been a very long time since any new blog posts have been posted about my current game project.

I have decided that my new year's resolution for 2019 will be to get my game finished and out there within this year; After all, it's almost at the point now where an MVP or Vertical Slice exists.

The claw has finally been fixed, and redone with a bit of kitbashing to make it nicer looking:

newclaw-1.thumb.jpg.d523b231cb47a5bebbc9afa5fe4d430a.jpg

Over the past year where there have been few blog posts, life has taken over and taken away a lot of the free time i had for gamedev. However over Christmas i have managed to get a bit more done again, and have moved onto where i left off, which was power-ups.

The game will have several power-ups, which are gained by successfully completing levels with some finesse, and can then be used to make finishing some levels easier, or in some cases possible at all - the first level which introduces power-ups cannot be completed without them.

Power-ups derive from a simple C++ class:


UCLASS()
class FWF_API ANativePowerup : public AActor
{
	GENERATED_BODY()
	
public:	
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Powerup")
	bool AllowDropOnMachines;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Powerup")
	bool AllowDropOnCrates;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Powerup")
	bool AllowDropOnJunctions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Powerup")
	bool AllowDropOnConveyors;

	// Sets default values for this actor's properties
	ANativePowerup();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Powerup")
	UStaticMeshComponent* Mesh;

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Powerup")
	UMaterial* GetSprite();

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Powerup")
	UAudioComponent* OnUseAudio;

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Powerup")
	void Pickup(const FVector &PickupLocation);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Powerup")
	void Use(const FVector &DropLocation);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Powerup")
	void UseOnMachine(class ANativeMachine *machine);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Powerup")
	void UseOnJunction(class ANativeJunction *junction);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Powerup")
	void UseOnCrate(class ANativeCrate *crate);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Powerup")
	void UseOnConveyor(class ANativeGridActor *conveyor);

	UFUNCTION(BlueprintCallable, BlueprintNativeEvent, BlueprintPure, Category = "Powerup")
	FString GetName();

};

Each of the boolean values at the top of the class indicate what a power-up may be dropped onto, each of which will have a different effect - some positive, and some negative. These booleans will allow the game to present a different (affirmative) cursor for elements that the power-up may be used on at all, to give the player some guidance and feedback.

The first such power-up is the wrench:

wrench.jpg.b27c859ef0d72b564d0e07e53e91ea26.jpg

This power-up can be dropped on either a machine, or a crate. If it is dropped on a machine, it disables that machine for ten seconds, during which time it will not produce crates. Any crates it would have produced will be moved to the back of the production queue and produced later. This may cause other machines to produce crates in different orders.

If you accidentally (or even on purpose) drop a wrench onto a crate, the crate will immediately explode.

If you continually use wrenches on a machine, each successive use damages the machine slightly much like sending a crate back through the same machine, eventually causing it to explode.

When the power-ups are dropped onto a supported object, the "UseOn*" methods, e.g. UseOnMachine() are called, where the object the power-up was dropped on is passed.

There is much more to come, after a few power-ups have been implemented (next on my list is glue, which causes crates to stick to the conveyor, and oil, which makes crates go faster, but is highly flammable!) I will be moving on to saving of the game state to a file, and selection of levels from a list of levels that have already been completed, via the main menu.

Once this is completed, I will be much closer to actually completing the vertical slice of the game which has been in progress for over a year now.

Feedback is as always more than welcome!

newclaw-2.jpg

3 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement