This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

FabriG
FabriG presents ...

2023/7/18

Fernand the Kinght

Fernand is a guy who wants to be a hero. For that reason, he will train himself going out and fighting enemies inspired by the medieval imaginary

1076 views / 8 in the last 7 days

Tags: game physics platformer platform platforms monsters enemies monster sword kinght

Your browser does not support the canvas tag.
KIITAKIIKIITAKII

2023/7/19

WHAT ARE THE CONTROLS, MAN? YOU CAN'T MAKE A GAME WITH THIS QUALITY AND NOT INCLUDE CONTROLS!!!!
FabriGFabriG

2023/7/19

Did you find them yet? You can do it by clicking on "how to play" in the play menu.
stylusstylus

2023/7/19

This is great! How did you manage to make the title screen appear on it own (there's a problem with this game I'm making where the game runs while the title screen shows, thus the player could lose before they get a chance to start.) If you could share the code for that, I'd greatly appreciate it.
FabriGFabriG

2023/7/19

That doesn't happen to me - Fernand always appears at the same spot whenever I restart the game. What I have seen though is that, when you die and restart the game, Fernand spawns without lives. That's an odd bug. What I do in that case is to restart this very website. Hope that helps. If not, please let me know so that I share the code.
stylusstylus

2023/7/19

That is an odd bug. Unfortunately, restarting the game does not fix my issue. If you could share your code, I would be able to see what differs from mine and find a way to temporarily "pause" the game until the player presses a certain action. I think what's different is that mine directly goes into the one level while yours changes to a level select screen. Regardless, thanks again for the help.
FabriGFabriG

2023/7/20

Alright, here's the code of the title screen, hope that helps :). import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class Background0 extends World { Flecha flecha = new Flecha(); private int opcion = 0; GreenfootSound backgroundMusic = new GreenfootSound("Intro.wav"); public Background0() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super(900, 500, 1); backgroundMusic.playLoop(); prepararMundo(); prepare(); } private void prepararMundo(){ addObject(new Fernan(), 263,121); addObject(new Start(),700,170); addObject(new SalirMenu(),700,250); addObject(flecha,614,170); } public void act(){ if (Greenfoot.isKeyDown("UP") && opcion!=0) {opcion++;} if (Greenfoot.isKeyDown("DOWN") && opcion!=1) {opcion--;} if (opcion>=2) opcion = 0; if (opcion<0) opcion = 1; flecha.setLocation(614, 170 + (opcion*95)); if (Greenfoot.isKeyDown("Space") || Greenfoot.isKeyDown("Enter")){ switch(opcion){ case 0: backgroundMusic.stop(); Greenfoot.delay(20); Greenfoot.setWorld(new BackgroudLvls()); break; case 1: Greenfoot.stop(); break; } } } /** * Prepare the world for the start of the program. * That is: create the initial objects and add them to the world. */ private void prepare() { } }
danpostdanpost

2023/7/20

@stylus, if your game is running with the menu up, then you probably have your menu in the same world as your game. Note that the world FabriG has provided code for is for the menu alone and has nothing to do with the playing of the game itself. The "enter" or "space" key with option zero will proceed to another world (BackgroundLvls) which probably still a world where game-play is not yet arrived at. A specific level world would be arrived at from there where the level is played out.
stylusstylus

2023/7/20

Thank you both, I was able to figure out the problem thanks to this. :)
KIITAKIIKIITAKII

2023/7/20

I found the controls lol... It was just hard to see, maybe you can update the GUI a bit lol, nice game tho

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.