Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
That 3d thing
#31
Here's a new zip with a new step and example added. This is about sub-sectors, heights and jumps, you'll probably need to experiment a lot on your own with this. Ask if anything is unclear Smile

Edit I will write complete api documentation later, of course.

Edit 2 Next up is probably static objects (in sprite and mesh form).


Attached Files
.zip   ea_tutorial.zip (Size: 3.17 MB / Downloads: 10)
Reply
#32
Cool... Leaping works very well... Nice.
Logic is the beginning of wisdom.
Reply
#33
The examples are very cool and it works very well. I have noticed that when you move the camera or move towards the walls, you see a kind of shadow on the walls that is generated or moved and it is somewhat annoying.
Reply
#34
(05-26-2024, 03:36 PM)aliensoldier Wrote: The examples are very cool and it works very well. I have noticed that when you move the camera or move towards the walls, you see a kind of shadow on the walls that is generated or moved and it is somewhat annoying.

I think you mean the retro fog thing Smile Change the first parameter to EA_Setfog from EA_RETRO to EA_NORMAL.
Reply
#35
Now it is much better. There is another thing that is somewhat annoying to my eyes, objects or walls that are far away cannot be seen because of a dark fog, is there some way to eliminate or reduce that darkness in the background.
Reply
#36
I had a really busy weekend. Jazz concert (my son) on Saturday and gymnastics competion (daughter) on Sunday. I wrote the code for the next step in the tutorial just now. Here's the proof:

https://naalaa.com/tmp/example_4.mp4

But the text will have to wait until tomorrow.
Reply
#37
Awww... Sad
Logic is the beginning of wisdom.
Reply
#38
(05-27-2024, 06:30 PM)Marcus Wrote: I had a really busy weekend. Jazz concert (my son) on Saturday and gymnastics competion (daughter) on Sunday. ....

You are so lucky to have an awesome family time. Great !!!
By the way, you may reply my question when you are free,  it's not urgent  Big Grin

   
click the image to zoom-in

I'm trying to make a kind of first-person-shooter game, but I believe I do it in a wrong way .... lol
a. Could you please advice me the right-way, where should I put the code of draw image weapon ?
b. And how to put the weapon at the middle of the bottom screen ?
    I can not put it as draw image weapon, width(primary)/2, height(primary) as it will draw out of screen.  

Code:
'---------------
' INITILIZATION
'---------------
include "myassets/enginea.n7"

set window "stargate",320,240,false,2
set redraw off

visible weapon = loadimage("myassets/shooter.png")

EA_SetView(primary, rad(65), 0.1,6)
EA_SetFog(EA_NORMAL, 255,255,255)

flags = EA_LoadMap("myassets/map.json")
player = unset
foreach f in flags
    if f.flag = "player"
        player = EA_FpsPlayer()
        player.SetPos(f.x,f.floorY, f.z)
    endif
next


'------
' MAIN
'------   
EA_AddObject(player)
EA_SetCamera(player)
player.SetMouseSens(0.3)

EA_SetUpdateAction(Update)

EA_Run()


'-----------
' FUNCTIONS
'-----------
function Update(dt)
    draw image weapon, 100,130
    redraw
    fwait 30

    if keydown(KEY_ESCAPE,true) then
        EA_Stop()
    endif
endfunc


Attached Files
.zip   stargate.zip (Size: 221.92 KB / Downloads: 3)
Reply
#39
(05-28-2024, 05:02 AM)1micha.elok Wrote:
(05-27-2024, 06:30 PM)Marcus Wrote: I had a really busy weekend. Jazz concert (my son) on Saturday and gymnastics competion (daughter) on Sunday. ....

You are so lucky to have an awesome family time. Great !!!
By the way, you may reply my question when you are free,  it's not urgent  Big Grin


click the image to zoom-in

I'm trying to make a kind of first-person-shooter game, but I believe I do it in a wrong way .... lol
a. Could you please advice me the right-way, where should I put the code of draw image weapon ?
b. And how to put the weapon at the middle of the bottom screen ?
    I can not put it as draw image weapon, width(primary)/2, height(primary) as it will draw out of screen.  

Code:
'---------------
' INITILIZATION
'---------------
include "myassets/enginea.n7"

set window "stargate",320,240,false,2
set redraw off

visible weapon = loadimage("myassets/shooter.png")

EA_SetView(primary, rad(65), 0.1,6)
EA_SetFog(EA_NORMAL, 255,255,255)

flags = EA_LoadMap("myassets/map.json")
player = unset
foreach f in flags
    if f.flag = "player"
        player = EA_FpsPlayer()
        player.SetPos(f.x,f.floorY, f.z)
    endif
next


'------
' MAIN
'------   
EA_AddObject(player)
EA_SetCamera(player)
player.SetMouseSens(0.3)

EA_SetUpdateAction(Update)

EA_Run()


'-----------
' FUNCTIONS
'-----------
function Update(dt)
    draw image weapon, 100,130
    redraw
    fwait 30

    if keydown(KEY_ESCAPE,true) then
        EA_Stop()
    endif
endfunc

The next step in the tutorial will show you how to do that, as you can see in the video above. But ... I can tell you right now. 

Use EA_SetDrawAction(func) to set a callback function that will be called every frame when the scene has been rendered:

Code:
EA_SetDrawAction(Draw)
...
function Draw()
    set color 255, 255, 255
    draw image gunImage, (width(primary) - width(gunImage))/2, height(primary) - height(gunImage)
endfunc
Reply
#40
Here's a zip with the fourth tutorial step included. It's about static billboard sprites.


Attached Files
.zip   ea_tutorial.zip (Size: 3.44 MB / Downloads: 5)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)