VS C/C++表白项目

这篇博客分享了一个使用VS C/C++编写的表白项目,包含流星图片和背景图片作为素材,建议配合浪漫音乐使用,祝读者表白成功。
摘要由CSDN通过智能技术生成

这个代码适合表白用的:

 

代码如下:

#include<stdio.h>
#include<graphics.h> //第三方图形库
#include<time.h>
#include<conio.h>

#include<mmsystem.h>
#pragma comment(lib,"winmm.lib")

#define STAR_NUM 500
#define METEOR_NUM 100

struct Star        //小星星
{
    int x;
    int y;
    int r;
    int speed;    //速度
    COLORREF color;    //颜色
};
struct Meteor
{
    int x;
    int y;
    int speed;
};
struct Star star[STAR_NUM];
struct Meteor meteor[METEOR_NUM];
/*@小星星*/
//初始化星星
void initStar(int i )
{
    star[i].x = rand() % getwidth();
    star[i].y = rand() % getheight();
    star[i].r = rand() % 3 + 1;
    star[i].speed = rand() % 5;
    star[i].color = RGB(rand() % 256, rand() % 256, rand() % 256);
}

//绘制星星
void drawStar()
{
    for (size_t i = 0; i < STAR_NUM; i++)
    {
        //putpixel(star[i].x, star[i].y, star[i].color);
        setfillcolor(star[i].colo
  • 3
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值