Log In  

BBS > Superblog
Posts: All | Following    GIFs: All | Postcarts    Off-site: Accounts

Cart #47681 | 2017-12-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Hello, I'm trying to develop a game in which there will be some enemies chasing the player on a map, and on this map there will be some obstacles.

I know how to code a simple AI in order to have enemies follow the player, by using math trigonometry functions like sine, cosine and arctangent; but I ACTUALLY HAVE NO IDEA about how to code an enemy AI in order to make it avoiding some obstacles on the screen.

Basically I'd like to code a simple AI that could chase the player on the map, but at the right time when it's about to collide with an obstacle could forget for a moment that chase and dodge the obstacle.

Do you have an idea about what I should try to implement ?
At the moment I've tried something very simple that tries to rotate around an obstacles while the trajectory between the enemy and the obstacle and the trajectory between the enemy and the player is equal or greater than 90 degrees. It's a really simple trick but it doesn't work 100% of the time.

This is my code:

function _init()
    -- initialize

    -- enemy
    e = {}
    e.f = 1
    e.x = 0
    e.y = 0
    -- player
    p = {}
    p.found = false
    p.distance_b = 0
    p.f = 2
    p.x = 118
    p.y = 118

    -- columns
    bb = {}
    b1 = {}
    b1.f = 3
    b1.x = 40
    b1.y = 40
    b2 = {}
    b2.f = 3
    b2.x = 80
    b2.y = 80
    add(bb, b1)
    add(bb, b2)
end

function object_collide_with(x1, y1, x2, y2, gx, gy)
	-- checks if an object has collided 
	-- with another object, then calculated
	-- the angle between the ball and the other object

    -- gx = gravity horizontal center
    -- gy = gravity vertical center

    if (gx == nil) gx = 4  -- 8x8 --> 8/2 
    if (gy == nil) gy = 4

	--local bump = c1 and c2 and c3 and c4
	local distance = sqrt(((x2+gx)-(x1+gx))^2 + ((y2+gy)-(y1+gy))^2)
    local angle = atan2((x1 + gx) - (x2 + gx), (y1 + gy) - (y2 + gy))
	local direction = flr(angle * 8)
	return distance, angle, direction
end

function player_collide_with(x, y, w, h)
	-- checks if the player has collided 
	-- with another object, then calculated
	-- the angle between the ball and the other object

	return object_collide_with(p.x, p.y, x, y, w, h)
end

function distance_between(x1, y1, x2, y2)
	-- calculates the distance between two points

	return sqrt((x2-x1)^2 + (y2-y1)^2)
end

function check_player()
    if (btn(0)) p.x -= 1
    if (btn(1)) p.x += 1
    if (btn(2)) p.y -= 1
    if (btn(3)) p.y += 1
end

function _update()
    check_player()
    p.found = false
    local distance, angle, direction
    -- check the distance from the target
    distance, angle, direction = player_collide_with(e.x, e.y)    
    for i, b in pairs(bb) do
        local distance_b, angle_b, direction_b = object_collide_with(b.x, b.y, e.x, e.y)        
        if distance_b <= 10 and abs(angle-angle_b) < 1/6 then
            angle_b += 3.1415/240
            e.x = b.x - cos(angle_b) * distance_b
            e.y = b.y - sin(angle_b) * distance_b            
            p.found = true
            break            
        end
    end
    if not p.found then
        e.x += cos(angle) 
        e.y += sin(angle)
    end    
    if distance_between(e.x, e.y, p.x, p.y) < 8 then
        -- reset if the enemy touches the player
        e.x = 0
        e.y = 0
    end
end

function _draw() 
    cls(0)
    for i, b in pairs(bb) do
        spr(b.f, b.x, b.y)
    end
    spr(p.f, p.x, p.y)
    spr(e.f, e.x, e.y)
end

[ Continue Reading.. ]

2
6 comments


Cart #47679 | 2017-12-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Zoom boom is an aerial avoidance game. Don't get hit by the missiles and pass through the objective rings!

----Controls----
Move:
Up, Down, Left, Right

Speed Boost:
z, x

1 comment


Cart #47677 | 2017-12-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Castle Fight is a side-shooter action game, in which your skill and your commitment are the last hope for the peasents of Lord Lazer.
Use the impressive canon of the wizard Bombastus Babo to defend the castle from the neverending terror of these mysterious beasts.

Through a cataclysm, a merge between different worlds and dimensions, severeal terrifying monsters came into the lands of Lord Lazer and start to destroy everything in their way.
Now it´s time for you to stand brave against these evil forces and save the day.

1
1 comment


Cart #47672 | 2017-12-25 | Code ▽ | Embed ▽ | No License
2

2
2 comments


Cart #47667 | 2017-12-25 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10

Merry Christmas Everyone!!!

Disclaimer, this game is about the true meaning of Christmas, Jesus! Enjoy :)

10
3 comments



(you can press [o] to remove the flying text)

Wishing everyone health, happiness, less bugs and some super good end-of-the-year holidays!!

And to a much better 2018, full of Pico-8 prototypes and demos! Cheers!!!

TRASEVOL_DOG

24
4 comments


Cart #47659 | 2017-12-24 | Code ▽ | Embed ▽ | No License

0 comments


Cart #47653 | 2017-12-23 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
22

Best wishes to everyone in the community for the coming Christmas, Winter Solstice Festival, Yule, or a random December weekend that has no special meaning to you!

Here's to another fine year for PICO-8! :)

22
3 comments


Cart #47648 | 2017-12-23 | Code ▽ | Embed ▽ | No License

Hey here is the beta version of our metroid-like game, Godhip! Feel free to give us some feedback in order ot improve it!

0 comments



Here's my latest creation. The goal is to score points by making closed paths. You lose a life when you try and place a tile where it won't fit with the existing tiles on the board. There's a timer which forces you to place if you haven't when it runs out. Bonus points if you make a closed loop with none of the end cap pieces.

Controls: Arrow to move the cursor, button 1 to place a tile and button 2 to hold.

Let me know what you think. :)

3
2 comments


You are a king in a insane Theme Park, and now you have to escape... before is too late!!


This is my first game in Pico-8, playing with ifs and thens here!

0 comments


CAUTION: Some areas in this game cause a significant flickering effect.

by Jusiv
Cart #47637 | 2017-12-22 | Code ▽ | Embed ▽ | No License
129

ABOUT:
NULL is a surreal adventure game. What you see in the end depends on what you can find on the way.
A 100% playthrough can be completed in 10-15 minutes, if you know where everything is.

This is my third full Pico-8 game (not counting stuff from game jams)! I made it over the course of November and December 2017. All assets and code are my own work.

If you want to see more of my stuff, check out my Twitter: @Jusiv_

CONTROLS:

  • Arrows: Move
  • Z/X/C: Interact

TIPS:

  • There are two types of things to find. Each area has exactly one of each.

[ Continue Reading.. ]

129
36 comments


Cart #47619 | 2017-12-22 | Code ▽ | Embed ▽ | No License
4


Help Santa gather the lost gifts in this fast-paced sidescrolling racer. Get them all and save christmas. Nothing worse than a weeping child lacking its christmas gifts.

Controls: Arrow-Keys and X

Music by @GruberMusic, originally found in "Xmas Sorted" by Paul Nicholas

Game is actually a modification of my game "Rey's Scavenger Run"

4
0 comments


Cart #47598 | 2017-12-22 | Code ▽ | Embed ▽ | No License
4


About The Game

Shoot Fireballs, bigger then you, and kill your Enemies on 5 different lanes and lands to become the very best Annabelle player!

Highscore Game!!

About Our Work - and background:

This game is created for a Game Jam of my School.
The School of Games
(Cologne, Germany)

Our limitation was to create a one screen Pico-8 game in 3 and a half days. The specific theme of the game was randomly chosen.
Viktoria Lierhaus - Game Design, Programmer,
Gian Paolo Licata - Game Design, Artist, Animation, Sound Effect and Title Screen Musik

Special thanks to everyone who has helped us!
For example!

  • Hannah Rodenbüsch, thank you for the Gameplay Music!
    Now we are Done!
  • Updates and Bug fixes (if we need them) will come fast.

Work - Day 1 Monday

  • build up Teams randomly
  • Our random Topic was: “unbalanced beat em up”
  • Brainstorming: (We want to create a game about #
    Cyber Cowboys! and Bounty Hunters!)
  • First Title: “something” of the western hill (I don't know what we had instead of “something…” .. 4 days ago…. bad first title… bad Topic)
  • First Idea: “Space invader clone from right to left instead of up to down. With
    Random Enemies and a little bit more control”

What we done: (day 1)
- Player control

  • Animation (Programming, not art)
    - Spawn (Programming)
    - Changed Topic (Little Girl, Demon)
    - Player Sprites ( Spend much time )
    - Map Size
    - First Map Model (ART) ext:

What we done: (day 2)
- Two of Four Enemies Draw (Artist)
- Two of Four Enemies Animation (Artist)
- Projectiles, Deleting Enemies.. etc. (Programmer)
- New Map Model

What we done: (day 3)
- Last two Enemies Draw (Artist)
- Last two Enemies Animation (Artist)
- Design Tutorial (With Pen and Paper)
- Title screen Music and Sfx
- Many Programming things! like health etc.
- Draw Title Screen,

What we done: (day 4 / Last day)
- Gameplay music by Hannah
- Shakes
- New Projectile
- Lose Screen
- Tutorial (Only Information, no gameplay tutorial)

Thank you for reading and playing!
Please send us feedback so we can do it better and better!

4
2 comments


I noticed this while streaming this week. If you are in another editor and hit Ctrl-Tab, the code tab will still change. For instance, if you're on Code Tab 1, go to the Sprite Editor, hit Ctrl-Tab while in the Sprite Editor, when you come back to the Code Editor, you'll now be in Code Tab 2. Not a huge deal, but definitely not expected.

0 comments


Cart #47588 | 2017-12-21 | Code ▽ | Embed ▽ | No License
3

Nurse'n'Slash

In a world, where exploding Nurses try to kill their patients...

What to do?
Patient Zero tries to resist against the evil exploding Nurses, so he arms himself and starts to fight them.

Why?

This game is the product of the Game Jam we had in the School of Games in Cologne, Germany.

The topic was to create an one screen Pico-8 game, the specific theme of the game was randomly chosen.

WIP History:

Day 1:

Prototyping;

What should we do? Any Ideas?
Both:"Dafuq is that topic?!"
"...Lofi Top-down Arena Shooter with exploding nurses"

[ Continue Reading.. ]

3
1 comment


Version: 0.1.11f

Steps to reproduce:

  1. Start a new PICO-8 instance
  2. Press escape
  3. Using only the mouse, open the SFX editor, navigate to SFX 01 and switch to tracker mode
  4. Using the keyboard, enter two notes and don't click any note position using the mouse
  5. Hold down shift and select the two notes using the cursor keys
  6. CTRL-C

Actual result:

  1. PICO-8 says it copied the SFX

Expected result:

  1. PICO-8 says it copied the notes

If in step 4 you use the mouse to pick the locations of the notes, it will copy the notes in step 7.

1
6 comments



A happy little Top Down Game

"The Destiny of Bob Ross is about a famous artist which wants to signature Stuff of his fans.
Your task as Bob Ross is it to paint your colorful signature all over the Map and right to your
following Bois.


The game is in working progress and the release will be on 21st December 2017.
Updates will follow as well as the first playable version.

School of Games (Cologne) – Game Jam | 18.12.2017 – 21.12.2017
• Random groups out of 2
• Normally 1 Programmer and 1 Artist
-> Micha & Maxi

Title Screen:

The Map:

Before_

After_

The final Map:

A happy little Preview of the game:

Well, we think we did it. Just right in time.
Here is the End Screen:

4
2 comments


A little quirk I ran into.

Version: 0.1.11f

Steps to reproduce:

  1. Start a new PICO-8 instance
  2. In SFX 01, switch to tracker mode and enter a value for the first note
  3. Set the loop end of SFX 01 to 02
  4. In SFX 01, enter a value for the third note (or any after that)

Expected result:

  1. You hear the note you just entered

Actual result:

  1. You hear the note you just entered plus the first note of the loop. The UI will also highlight the first note as if being played. The additional note being played will change when you change the loop start setting.
3 comments


Castle Fight is a side-shooter action game, in which your skill and your commitment are the last hope for the peasents of Lord Lazer.
Use the impressive canon of the wizard Bombastus Babo to defend the castle from the neverending terror of these mysterious beasts.

Through a cataclysm, a merge between different worlds and dimensions, severeal terrifying monsters came into the lands of Lord Lazer and start to destroy everything in their way.
Now it´s time for you to stand brave against these evil forces and save the day.

2
1 comment




Top    Load More Posts ->