Function that does not stop.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
LeMilliCraft
Prole
Posts: 3
Joined: Mon Aug 15, 2022 9:59 am

Function that does not stop.

Post by LeMilliCraft »

Hello, I started by creating a game and my first step is to be able to put your nickname. The problem is that the function never stops even when I finish I can change the name. I think it's due to an error on my part if someone can enlighten me that would be good. Thank you in advance and sorry if there are mistakes I am French, have a nice day.

The game is attached;
Attachments
pseudo.lua
(1.2 KiB) Downloaded 47 times
main.lua
(17 Bytes) Downloaded 47 times
game.lua
(868 Bytes) Downloaded 44 times
User avatar
togFox
Party member
Posts: 770
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Function that does not stop.

Post by togFox »

Wow. Um. Not sure where to start.

Ignoring the unusual file structure for a moment.

When I run the script I get big white box. When I click it I get something that captures keystrokes. That actually works so - well done. :) When I press ENTER, I get a big white circle. Apart from odd behaviour, the text input actually works so not sure how to answer your question. I think your circle is too large. You have radius 50. I made it 10 and I think it works as expected.

When you say the "function never stops" - I don't experience that so perhaps that's a french thing - or not.

Some other tips you didn't ask for:
- having a main.lua with just one line doesn't make a lot of sense. Put more code into main.lua to make it useful. Start by moving love.draw, love.mousepressed, love.update there.
- you have love.draw defined twice. Don't do that.
- don't call REQUIRE in the middle of some function. That's simply confusing. Write a function and then call the function.


I can see you are beginning to understand the basics. Keep trying. :)
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Function that does not stop.

Post by pgimeno »

My interpretation of the OP's problem is that after entering the name, they can't move on to something else: the edit control does not stop responding to keys.

Note: I haven't downloaded the code.
LeMilliCraft
Prole
Posts: 3
Joined: Mon Aug 15, 2022 9:59 am

Re: Function that does not stop.

Post by LeMilliCraft »

togFox wrote: Mon Aug 15, 2022 11:03 am
Thank you very much for your advice, but the problem is not solved, the problem and that after having clicked on "enter" you can still modify your name which is displayed at the top left of the screen.
LeMilliCraft
Prole
Posts: 3
Joined: Mon Aug 15, 2022 9:59 am

Re: Function that does not stop.

Post by LeMilliCraft »

infact if it finally works thank you very much for your help, have a nice day.
Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests