Frotty / Frentity

Hierarchical Entity Framework
Apache License 2.0
11 stars 6 forks source link

Added mouse detection support to the Api. #3

Closed pleonar3 closed 5 years ago

pleonar3 commented 6 years ago

Also made the player init loop correctly.

pleonar3 commented 6 years ago

I'll be making these changes when I get the chance. Thanks Frotty, your input is very valuable.

Frotty commented 6 years ago

I'll be making these changes when I get the chance. Thanks Frotty, your input is very valuable.

Cool! I never really expected anyone to use this framework let alone make a PR for it 👍 And perhaps with my feedback you also learn to use wurst more efficiently from the start. So it's a win-win !

ps: I also enabled travis to build pull requests for frentity now, so next time u push it will be triggered as well.

pps: Don't forget to star the WurstScript repo and this one if you enjoy this stuff :)

pleonar3 commented 6 years ago

Agreed, win win.

Sidenote - I won't get make many updates until next week, i am away for labor day weekend.

Also, since the event api is in wurst STD lib I'll need to make a small pull request to that or the mousestatus won't work.

On Fri, Aug 31, 2018, 13:58 Frotty notifications@github.com wrote:

I'll be making these changes when I get the chance. Thanks Frotty, your input is very valuable.

Cool! I never really expected anyone to use this framework let alone make a PR for it 👍 And perhaps with my feedback you also learn to use wurst more efficiently from the start. So it's a win-win !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Frotty/Frentity/pull/3#issuecomment-417743889, or mute the thread https://github.com/notifications/unsubscribe-auth/ANM5ODZGobIk53tLlMOe536RFj9cE0sAks5uWXkqgaJpZM4WUfZC .

pleonar3 commented 6 years ago

@Frotty Went ahead and made those changes.

Also, had to add the following lines to wurst standard library in the ClosureEvents package:

        ..registerPlayerEvent(players[i], EVENT_PLAYER_MOUSE_UP)
        ..registerPlayerEvent(players[i], EVENT_PLAYER_MOUSE_DOWN)
        ..registerPlayerEvent(players[i], EVENT_PLAYER_MOUSE_MOVE)

Tested the package with this code:

package Hello
import ClosureTimers
import MouseUtils

constant HELLO_MESSAGE_BASE = "Hello, {0}!"

/* Hello and welcome to Wurst!
This is just a demo package. 
You can modify it to tests things out 
and then later delete it and create your own, new packages.
Enjoy WurstScript? Consider starring our repo https://github.com/wurstscript/WurstScript */

unit u

function test() returns boolean
    return true

init
    doAfter(0.01) ->
        let g = GetUnitsOfPlayerAll(Player(0))
        ForGroup(g) ->
            u = GetEnumUnit()
            print("set u = {0}".format(u.getName()))

    doPeriodically(0.01) cb ->
        var mouseStatus = Player(0).getMouseStatus()
        if (mouseStatus.left)
            u.setPos(mouseStatus.position)
            print("test")

Everything worked! Want to use this code to try and create a simple shooter, will do later when have time.

Frotty commented 6 years ago

Yea looks good now 👍 A few minor things and then I will merge! Thanks again 🍺

Frotty commented 5 years ago

thy again @pleonar3 This was merged into stdlib.