• Home
  • Index
  • Search
  • Download
  • Server Rules
  • House Roleplay Laws
  • Player Utilities
  • Player Help
  • Forum Utilities
  • Returning Player?
  • Toggle Sidebar
Interactive Nav-Map
Interactive DarkMap
Tutorials
New Wiki
ID reference
Restart reference
Players Online
Player Activity
Faction Activity
Player Base Status
Discord Help Channel
DarkStat
Server public configs
POB Administration
Missing Powerplant
Stuck in Connecticut
Account Banned
Lost Ship/Account
POB Restoration
Disconnected
Member List
Forum Stats
Show Team
View New Posts
View Today's Posts
Calendar
Help
Archive Mode




Hi there Guest,  
Existing user?   Sign in    Create account
Login
Username:
Password: Lost Password?
 
  Discovery Gaming Community The Community Real Life Discussion
« Previous 1 … 80 81 82 83 84 … 246 Next »
A lil C# help

Server Time (24h)

Players Online

Active Events - Scoreboard

Latest activity

A lil C# help
Offline utrack
05-02-2013, 01:56 PM,
#10
Member
Posts: 368
Threads: 16
Joined: Jan 2013

@massdriver: rofl
i can't into english lately

@crackpunch: well, here's example
Code:
public partial class FormWithTimer : Form
    {
        Timer timer = new Timer();

        public FormWithTimer()
        {
            InitializeComponent();

            timer.Tick += new EventHandler(timer_Tick); // Everytime timer ticks, timer_Tick will be called
            timer.Interval = (1000) / (25);             // 25 FPS
            timer.Enabled = true;                       // Enable the timer
            timer.Start();                              // Start the timer
        }

        void timer_Tick(object sender, EventArgs e)
        {
            RenewImage();
        }
    }
goes kinda like that.

For the moving part - maybe you'll need UpwardShot and DownwardShot classes ('cause there could be more than one shot at once) with refresh methods and coords properties, and Refresh() will be called by RenewImage procedure which will just add some points when called.

Then for enemies: again classes for each type of enemy and some simple variable as step count, which will be ++'d each frame - and simple "select case" with this variable which will decide which coordinate to change on refresh. After some point it should be zeroed, cause you want them to move in loop.

Then you should get all the instances with their coordinates and place bitmaps using these coords. DOne - frame ready

P.S.: this could work only for uni project, for production better use 2D DX or OpenGL
P.P.S.: this algorithm was written under the influence of beer, and i don't know what performance it'll get. The code will look nicely tho

[11:20:20] aerelm: its not fl dev work if you dont have to power through the whole thing on your own
[11:20:32] aerelm: help is for pussy devs like in dota
topic Discovery Server Watcher | FL Open Server | Account Manager G2 topic
something something zoners
  Reply  


Messages In This Thread
A lil C# help - by Huhuh - 05-02-2013, 12:05 PM
RE: A lil C# help - by Bitjump - 05-02-2013, 12:19 PM
RE: A lil C# help - by massdriver - 05-02-2013, 12:44 PM
RE: A lil C# help - by Bitjump - 05-02-2013, 12:48 PM
RE: A lil C# help - by utrack - 05-02-2013, 12:48 PM
RE: A lil C# help - by Huhuh - 05-02-2013, 01:18 PM
RE: A lil C# help - by massdriver - 05-02-2013, 01:24 PM
RE: A lil C# help - by massdriver - 05-02-2013, 01:23 PM
RE: A lil C# help - by Huhuh - 05-02-2013, 01:55 PM
RE: A lil C# help - by utrack - 05-02-2013, 01:56 PM
RE: A lil C# help - by Huhuh - 05-02-2013, 02:13 PM
RE: A lil C# help - by Huhuh - 05-06-2013, 11:07 AM
RE: A lil C# help - by Huhuh - 05-15-2013, 08:58 AM
RE: A lil C# help - by Stuffz - 05-15-2013, 11:39 AM
RE: A lil C# help - by Huhuh - 05-16-2013, 01:24 PM
RE: A lil C# help - by Stuffz - 05-16-2013, 01:38 PM
RE: A lil C# help - by Huhuh - 05-16-2013, 01:47 PM
RE: A lil C# help - by Ichiru - 05-16-2013, 01:53 PM
RE: A lil C# help - by Huhuh - 05-16-2013, 02:03 PM
RE: A lil C# help - by Stuffz - 05-16-2013, 02:11 PM
RE: A lil C# help - by Huhuh - 05-30-2013, 02:29 AM

  • View a Printable Version
  • Subscribe to this thread


Users browsing this thread:
1 Guest(s)



Powered By MyBB, © 2002-2026 MyBB Group. Theme © 2014 iAndrew & DiscoveryGC
  • Contact Us
  •  Lite mode
Linear Mode
Threaded Mode