Making my first Pulp Game (No Coding Experience)

Hey guys, I m new here and lately I have been experimenting with a collect-a-thon idea for Pulp. This is the first time making a game on any platform/in any software. I've managed to create three levels thus far, but I am running into three issues here:

One: How do I make it to where, the exit doesn't open until all items are connected, and how do I create enemy A.I. that can chase the main sprite?

I also want to create a score system based on items collected and how quickly the level is completed. but do not know where to begin?

Well, I have an idea for the exits,

You could have the exit inside a sprite (so it can't be accessed) then, when you collect all the items, the sprite disappears, and lets the player enter, the item's code would look something like this:

on collect do
coins += 1
if coins==12 then
emit "playWhite"
end
end

And the sprite's code would look like this:

on exitblock do
play "white"
end

Hope this helps!

I tell you what, I'll give this a try soon and if it works I'll slap your name in the credits. Right now my current problem is a big one. I have managed to figure out Enemy A.I. but the issue I face is that when he moves, he removes tiles will him. And I mean, it is erasing the playfield. I'll include code below... can you tell me what I am missing? The Enemy Sprite is beneath my player sprite(I haven't added collision yet)

GAME SCRIPT:

on load do
enemyMoveInterval = 8
end

on loop do
fElapsed = event.frame
fElapsed /= enemyMoveInterval
fElapsedFloor = floor fElapsed
if fElapsed==fElapsedFloor then
emit "eventMoveUpdate"

end

end

ENEMY SCRIPT:

on eventMoveUpdate do
newEnemyX = event.x
newEnemyY = event.y
if event.pxnewEnemyX then
newEnemyX++

end

tileAtNewPos = name newEnemyX,newEnemyY
if tileAtNewPos!="white" then
	newEmemyX = event.x
end

if event.py<newEnemyY then
	newEnemyY--
elseif event.py>newEnemyY then
	newEnemyY++
end

tileAtNewPos = name newEnemyX,newEnemyY
if tileAtNewPos!="white" then
	newEnemyY = event.y
end

swap "white"
tell newEnemyX,newEnemyY to
	swap "enemy"
end

end

So, it appears in the code you put "EmemyX" instead of "EnemyX" so here's the fix:

ENEMY SCRIPT:

on eventMoveUpdate do
newEnemyX = event.x
newEnemyY = event.y
if event.pxnewEnemyX then
newEnemyX++

end

tileAtNewPos = name newEnemyX,newEnemyY
if tileAtNewPos!="white" then
newEnemyX = event.x
end

if event.pynewEnemyY then
newEnemyY++
end

tileAtNewPos = name newEnemyX,newEnemyY
if tileAtNewPos!="white" then
newEnemyY = event.y
end

swap "white"
tell newEnemyX,newEnemyY to
swap "enemy"
end
end

Also, truth be told, I haven't experience using AI in pulp, it might help if you explain a little better, but, if I could guess, it seems you just need to make sure you know what tile the enemy will move on, then make sure the enemy script knows and puts the tile back in its correct place when it is done.

So i did go back and correct the "Ememy" mistake, and even went and rewrote the entire script... now the sprite doesn't move. Odd... if i misspell it again, it will move around... I wonder if i could manipulate this glitch? :thinking:

Regarding your question, I am not really sure how the enemy ai works at this time... I got the idea originally from one of SquidGod's video. Because I am still learning, I don't fully understand the pulp script documentation, at this time. Also, I am more of a visual learner, so anyone who could help me, would be a huuuge help.

EDIT: I've discovered that, the enemy sprite doesn't like to pass through items (The coins) but he will chase me now if i remove everything in it's path... my goal, is to make him consume coins as he walks, because the goal of the game is to collect the most coins for a high score... on the bright side, he no longer tries to consume the walls.... so that's clearly a step in the right direction

Well, you could have it detect if a coin is right where it will walk, and change a value, like this:

if tile==“coin” then
coin += 1

And you can make that coin a tile, so it will pass over it, and the code will make it disappear (because the “removing tiles” bug turns the coin tile to a white tile)

1 Like

It's been a month and I have decided to revisit this post. I am going to make a video showing what the game is doing, and what I would like for it to do.

I am basically trying the best I can to make PacMan.

Here is a three minute video of what is going wrong. A few notes:

I have it to where the player can collect coins, but the enemy gets stuck in place unless i change the coins name to 'White'. But then this introduces a new problem. It leaves coins behind.

What i need the enemy to do, is either walk over the coins or consume the coins. If it consumes the coins, I will need it to either penalize the score or do nothing at all.

I have yet to figure out how to create a score system yet.

Sample Video

Basically I would like to create One Bit Packman which was made by one of our beloved devs here (oscarbraindead)

video2

In your enemy script you are presumably using swap to "move" the enemies around the room. In Pulp of course everything is a tile and swap is replacing the tile at that location, so you need some way to track what tile the enemy is replacing. Conceptually the enemy is "above" that part of the room, but Pulp itself doesn't work like that!

There are two main approaches you can take to solve this:

  1. Make each enemy its own unique tile and keep track of the tile the enemy is "above" in a uniquely named variable.
  2. Make "combination" tiles for each tile the enemy can be above e.g. "ghost on space" and "ghost on pellet" so the correct tile can be swapped back in the tile's script.

(2) is a good option if you want lots of the same enemy in a room and have only a few different tiles they can move over. (1) is the best option if you have unique enemies, for example if you decide each ghost should have their own appearance and behaviour like in the original pacman.

1 Like

First off, I'd like to thank you for all of your help, both here and in discord. You're awesome!

Secondly, just an update on the things I have fixed and learned so far. For example, I've learned how to set up a score system in-game and also thanks to a nice tutorial by ghrmhome, I've been able to implement score chains. (Link here -> CLICK ME)

I've learned that the following script on an ITEM will allow me to give specific numbers or take away specific numbers to the code by either adding a + or - to the equation.

It looks like so:

on collect do
score += 3500
swap "white"
end

Very basic. Very helpful. I have also discovered three separate glitches in my "Mistakes" that I intend to intentionally implement in a future project (MAYBE) as they can create some interesting and unique elements. Kinda excited about that. I'll share them later if I can make it function the way I think I can.

Lastly, thanks to Kliest and his helpful Chaser Tutorial, I have managed to figure out how to get my enemy to do what I need it to do. (LINK --> CLICK ME)

Currently, I have the general game mechanics required to finish my game. Now I need to focus on two other things:

A health System (3 Lives max)
Enemy alternatives
Unique gameplay features
Style (As the style present above will not represent the final version).
Fair Score Mechanics
Re-playability.

MY FINAL QUESTION (and I've yet to see this in this forum) IS WEATHER OR NOT PULP CAN SUPPORT LEADER BOARDS.

1 Like

UPDATE:

WHAT I AM MOSTLY CONFUSED ABOUT THIS PART IS: When you collect 125 coins, a door opens. but it doesn't subtract those coins. I don't know how to fix this as the lock mechanic and unlock mechanic in my other game works fine, but does not work fine here. I don't know the right question to ask.

It does not. Swap Machina was made in Pulp and has leaderboards, but that was converted to Lua using Pulp Mill.

Sounds like you are missing the line coins -= 125 :smile:

Thank you for the info on Swap Mechina, and as for the coin -=125, I thought the same thing too but it didn't subtract the amount. In fact it didn't do anything at all which has me scratching my head. I'll be getting back into on Monday as I'm currently at a Comiccon event in Florida :grinning: