BASIC

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Snoopy

Pages: [1] 2 3 ... 14
1
Competitions / Re: Hello World - Contest
« on: 2019-Mar-14 »
Use the space key to find out who is saying "Hello World" ;)

Code: GLBasic [Select]
// --------------------------------- //
// Project: CompHelloWorld


GLOBAL ok%, ntest%, pos%, line$
GLOBAL fw%, fh%

GLOBAL site$ = "www.glbasic.com"
GLOBAL page$ = "xmlhelp.php?lang=en&id=69&action=view"
GLOBAL file$ = "print.php"
GLOBAL normal_helloworld$ = "Hello World", complicated_helloworld$


WHILE ok% = FALSE
        ok% = NETWEBGET(site$, "/"+page$, 80, file$)                                                                                              // Get the file ont the net
        SLEEP 2000
        INC ntest%
        IF ntest% >= 10 THEN GOTO error
WEND


ok% = OPENFILE(1, file$, TRUE)                                                                                                                            // Open the file
IF ok%
        WHILE TRUE                                                                                                                                                       // Scan the Hello World in the file
                READLINE 1, line$
                pos% = INSTR(line$, normal_helloworld$)
                complicated_helloworld$ = MID$(line$, pos%, LEN(normal_helloworld$))
                IF complicated_helloworld$ = normal_helloworld$ THEN BREAK
                IF ENDOFFILE(1)
                        CLOSEFILE 1
                        GOTO error
                ENDIF
        WEND
ELSE
        CLOSEFILE 1
        GOTO error
ENDIF
CLOSEFILE 1


GETFONTSIZE fw%, fh%
WHILE TRUE
        PRINT UCASE$(complicated_helloworld$), 0, 0                                                                                             // HELLO WORLD
        IF KEY(57) THEN PRINT "FROM " + UCASE$(site$), (LEN(complicated_helloworld$) + 1) * fw%, 0, TRUE        // FROM A SITE IN THE WORLD
        SHOWSCREEN
WEND

END


error:
PRINT "ARGHH!! NOT HELLO WORLD FROM " + UCASE$(site$), 0, 0

SHOWSCREEN
MOUSEWAIT

END
 

2
Competitions / Re: Hello World - Contest
« on: 2019-Mar-13 »
 :D Funny !

Just a question, can it be complicated and short or the number of lines of code is also important?

3
No, but it's ok now, it was just a cloning problem with objects and I took the opportunity to ask for information on multitexturing.
But you're right, one day I will have to look at the source code.

4
It's a good start I think.
I look forward to see the rest.


5
Yes, of course, but not the coordinates of the texture, as I have said, it's a problem for the lightmapping.
In fact, I had:
- different objects.
- similar objects but with different texture coordinates.
- but also similar objects with the same texture coordinates ... it's stupid  =D (especially for the low speed gained during the display).

I take this topic to ask you if one day the problem to make a lightmapping will be solved?
In summary, the possibility to assign multiple textures with different coordinates on the same object.
I think the lightmapping is important in a 3D game for a good rendering without asking the GPU too much (especially on mobile).

6
GLBasic - en / Re: Smooth scroll
« on: 2019-Mar-06 »
Quote
I will change the code to integers and check the results. :good:

In summary, I broke my head to give you an example that works with floats for nothing  :D
Too bad, I'm sure it could have been the beginning of a beautiful library specifically dedicated to this type of games with for example sprites by layers, sprites moving between each layer, ... 
A kind of 2.5D graphic engine ;)

Quote
Really sad news about Bak...

Thank you for him  :booze:

7
GLBasic - en / Re: Smooth scroll
« on: 2019-Mar-05 »
Unfortunately, this does not solve the problem of tremor with floating values.
In fact, the only way in opengl is to create a pseudo-3D.
Here is an example that is easily adaptable (and maybe, can be transformed into a real library).
Sorry if I didn't comment more, I did it tonight and I'm a little tired (also sorry if the code is not very clean).

Use "+" or "-" to speed up or slow down scrolling.

I take this comment to salute the memory of Steve Bak who left us last month... in almost total indifference :rant:
He was the king of scrolling on Atari, vertically (Goldrunner), horizontally (Return to Genesis) and horizontally with parallax (StarRay).

R.I.P Master... :booze:  ...   :'(


http://atariage.com/forums/topic/288000-rip-steve-bak/

8
Bug Reports / Re: MOUSEAXIS fails
« on: 2019-Mar-01 »
Too bad  :(
With my solution, I totally solved my problem, even if yours is not quite the same, try anyway because I don't think it's a GLB bug, I think is one of the reasons why there is always an option in a 3D game to control the sensitivity of the mouse  ;)

9
Yes, it's not so strange :)

Here are some reasons:
1 / We can only assign one texture per object (it's also a problem for the lightmapping).
2 / You have implemented a frustrum optimization by object (thanks, needless to do it), so it's interesting for speed.
3 / For example, games like Minecraft require a lot of objects.
4 / Moreover, what is important for the speed (and the memory) in Opengl is not the number of objects but the complexity of each object.

But rest assured, on the maps where I need more, I will assign them on the fly (I hope without much slowdown).

Thank you for your interest and long life to GLB on Steam  :good:

--- EDIT ---

Hmm ... after Gernot's intervention, I thought about it and maybe I was wrong.
I'm looking for too much speed, I'll see my algorithm again tomorrow.

Thank you Gernot you helped me without even answering me  :D

10
Bug Reports / Re: MOUSEAXIS fails
« on: 2019-Feb-25 »
  :D Indeed, it's a very big problem for the player
Your problem interests me because I'm also developing a 3D project and have a similar problem, but not exactly the same as you.
But it's an FPS and not a spaceship simulation, that's probably the reason for the difference.

Glad you're found a solution and good luck on your project, Hemlos  :good:

11
Bug Reports / Re: MOUSEAXIS fails
« on: 2019-Feb-23 »
Do you have an example of your problem, Hemlos ?
Not your main code, just an example that sums up the problem you have in your pricinpale program.
Your problem intrigues me ;)

12
Bug Reports / Re: MOUSEAXIS fails
« on: 2019-Feb-21 »
When I reread Hemlos' comments, I thought it was a similar problem, but in fact it was not quite like mine (for me, it was with MOUSESTATE and only when there had a loss of FPS for a long time).
Moreover, I think my problem is not a GLB bug.

For the problem of Hemlos, you have probably the best solution MrPlow :good:

13
Bug Reports / Re: MOUSEAXIS fails
« on: 2019-Feb-21 »
Maybe, but seeing a SLEEP in a main loop bothers me a lot  ;)

14
Bug Reports / Re: MOUSEAXIS fails
« on: 2019-Feb-21 »
I already noticed this bug but I think that using a SLEEP in a main loop is not good.
Try not to multiply the speed of the mouse_velocity by a delta time but with a mouse_speed variable that the player of your game will be able to modify in the options.

Code: GLBasic [Select]
delta_time = GETTIMER()
// mouse_x_velocity = mouse_x_velocity * delta_time
// mouse_y_velocity = mouse_y_velocity * delta_time
mouse_x_velocity = mouse_x_velocity * mouse_speed  // A variable between 0.0 --- 1.0 ----> 2.0 (or more) it's the player who will choose.
mouse_y_velocity = mouse_y_velocity * mouse_speed
 

And use this code in your main loop instead of MOUSEAXIS to get the velocity (and if everything works well, you'll be able to test with MOUSEAXIS).
   
Code: GLBasic [Select]
MOUSESTATE mouse_x, mouse_y, mouse_b1, mouse_b2

// Your rendering ....

SETMOUSE screen_x_center, screen_y_center
mouse_x_velocity = mouse_x - screen_x_center
mouse_y_velocity = mouse_y - screen_y_center
 

I hope it will help you.

15
 :D Very good and nice example Erico.

Pages: [1] 2 3 ... 14