User Tag List

Page 23 of 23 FirstFirst ... 13212223
Results 221 to 227 of 227
  1. #221
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,380
    Country:
    Making a game to help me touch type faster, goal is to type a-z as fast as possible, can easily add numbers and symbols if required.



  2. #222
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,380
    Country:
    Started work on graphics:


  3. #223

  4. #224
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,380
    Country:
    Updated my unix epoc to readabe string module: https://github.com/scottadkin/TimeDisplay

    TimeDisplay
    Simple class to conver unix epoch times to strings.

    Usage:

    How to create a new instance of TimeDisplay:
    let potato = new TimeDisplay("1528983666");

    How to get the string:
    let newString = potato.timeString();

    // output: 5 mins 10 secs

    Change Log:
    Version 1.2 15th November 2018:

    Added function "getDefaultString()" this has replaced the ugly copy and paste code that was used before, and there for is much easier to modify to your needs. It also checks if the second value is 0 and ignores it if that is the case.
    Added support for character arguments for function "getUnitString()", you can now pass "s" for the first argument instead of 0 for seconds, "m" for minutes instead of 1 and so on.
    Function "timeString()" no longer returns a blank value string for the second value of a time string. e.g 13 minutes and seconds.

  5. #225
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,380
    Country:
    Making a crawler for the F1 site so i can collect data and display them in retro tv styles, starting with 2004-2009 TV HUD style



  6. #226
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,380
    Country:
    Finally learning ReactJS, changing the forum i've been making to use it to make it nice and snappy:




    Code:
    class TimeString extends React.Component{
    
    
        constructor(props){
    
            super(props);
            this.state = {"time":0};
        }
    
        componentDidMount(){
    
            
        }
    
        render(){
    
            return <div className="time">30957209</div>
        }
    }
    
    class Section extends React.Component{
    
        constructor(props){
    
            super(props);
            this.state = {"sections":0};
        }
    
    
        componentDidMount(){
    
            console.log("Everything is ok now shut the fuck up");
        }
    
    
        render(){
            const d = this.props.data[this.props.section];
    
            console.log("d.cat = "+d.cat+" this.props.cat = "+this.props.cat);
    
            if(d.cat != this.props.cat){
                return <div className="hidden"></div>
            }
            let image = "files/folder.png"
    
            if(this.props.image != ""){
                
                image = this.props.image;
            }
    
            return <div className="forum-section">
    
                <a href={"index.php?m=cat&id="+d.id}>
                    <div className="forum-section-title">
                        {d.name}
                    </div>
                    <div className="forum-section-image">
                        <img src={image} alt="image"/>
                    </div>
                    <div className="forum-section-data">
                        Topics: {d.topics}<br/>
                        Posts: {d.posts}  
                    </div>
                    <div className="forum-section-last">
                        Last Post by {d.last_user} <TimeString time={d.last_post}/>{d.last_post} ago
                    </div>
                </a>   
            </div>
        }
    }
    
    
    class Category extends React.Component{
    
        constructor(props){
    
            super(props);
            this.state = {};
            this.currentSection = -1;
        }
    
    
    
        render(){
            
            return <div className="forum-cat">
                
                <div className="forum-cat-title">
                    {this.props.data.name}
                </div>
                <div className="forum-cat-desc">
                
                    {this.props.data.description}
    
                </div>
                <div className="forum-section-outter">
                    
    
               
                    { this.props.data.sections.map(() =>{
                        this.currentSection++;
                        return <Section key={this.currentSection} cat={this.props.data.id} image={this.props.data.new_image} section={this.currentSection} data={this.props.data.sections}/>
                    })}
                
    
    
            </div></div>
        }
    }
    
    
    class CategoryLoader extends React.Component{
    
    
        constructor(props){
    
            super(props);
            this.state = {
                "data":0,
                "cats":[]
            };
    
            this.categoriesLoaded = -1;
        }
    
        componentDidMount(){
            console.log('hello there');
            this.loadJSON();
        }
    
    
        loadJSON(){
    
            const x = new XMLHttpRequest();
    
            x.onreadystatechange = () =>{
    
                if(x.status == 200 && x.readyState == 4){
                    console.log(x.responseText);
                    this.setCategoryData(x.responseText);
                }
            }
    
            x.open("POST","ajax.php");
            x.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            x.send("c=0&cats=0");
        }
    
        setCategoryData(data){
    
    
    
            this.setState({cats:JSON.parse(data)});
        }
    
        render(){
    
    
            
        
    
            return <div>{this.state.cats.map(() =>{
                this.categoriesLoaded++;
                return <Category key={this.categoriesLoaded} data={this.state.cats[this.categoriesLoaded]}/>
            })}</div>
            
        }
    }

  7. #227
    Whicked Sick UT-Sniper-SJA94's Avatar
    Join Date
    Oct 2011
    Location
    What was England
    Posts
    4,380
    Country:
    While developing hitdog invaders I discovered something that's probably obvious to other people, in the game I was using one Image() object, and then an array of 2 file url strings to change the source for different events(instead of using a sprite like i do with other stuff, because it's overlapping the face with a red silhouette for straining effect, with changing levels of alpha), on google chrome everything was fine ~144fps, then I checked firefox 144-70fps, then Edge 12fps.

    Firefox and Edge do not like it if you change an Image objects .src to another file in requestAnimationFrame(), if you have multiple objects doing it at the same time it will cripple performance to a stand still.




Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Another random game
    By UT-Sniper-SJA94 in forum Spam Section
    Replies: 79
    Last Post: 06-29-2015, 08:59 PM
  2. Random siege gif.
    By Chamberly in forum Screenshots
    Replies: 8
    Last Post: 01-05-2015, 05:17 AM
  3. Ben10 / Random / random Anime names
    By uenz in forum Reports/Complaints & Appeals
    Replies: 7
    Last Post: 08-30-2014, 03:43 PM
  4. Random bug
    By UT-Sniper-SJA94 in forum Spam Section
    Replies: 7
    Last Post: 03-13-2014, 12:22 PM
  5. Everybody random guy
    By |uK|B|aZe//. in forum Bans
    Replies: 0
    Last Post: 12-23-2011, 11:31 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •