Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. davidhoare
D

davidhoare

@davidhoare

Chat Follow Unfollow
0
Reputation
3
Posts
1.5k
Profile views
0
Followers
0
Following
Joined 14 Dec 2018, 15:53 Last Online 20 Dec 2020, 16:02

  • Profile
  • More
    • Continue chat with davidhoare
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups
davidhoare Follow

Posts made by davidhoare

card-matching game

Hi - In this time of isolation, I just built a quick multiplayer card-matching game for my mother to play with her grandchildren.
Thought I'd share, and say a big thank-you to Endel and the community!
https://github.com/davidroberthoare/matchmoji

alt text

posted in Showcase • 20 Dec 2020, 16:02
'random' clock timing

I'm trying to create some 'bot' players in my game (controlled server-side) that act at 'random' times.
My concept was to fire a clock.setTimeout() with a random time, that calls the 'botActions' function, and at the end of that function calls itself again using another setTimeout with a different 'random' time.
However, within the first this.clock.setTimeout, I can't seem to access this.clock.setTimeout... "this" is undefined...
Scope issue, I assume...? Is there a more 'proper' way to accomplish this?
Thanks!
David

without random time

botUpdate(data){
        console.log("bot clock tick:", data);
        this.clock.setTimeout(this.botUpdate, 1000, {botID : data.botID});
}

this.clock.setTimeout(this.botUpdate, 1000, {botID : data.botID});
TypeError: Cannot read property 'setTimeout' of undefined

posted in Questions & Help • 19 Dec 2018, 20:11

© 2023 Endel Dreyer