575day(方向键控制的行走的小人.html)

小实操(3): 利用键盘事件实现小人快跑 ** 实例: 利用html表单和js的数学对象及函数做一个有验证码的简单登录表单 实操:利用日期对象和方法以及其他相关知识实现简单的钟表功能 。。。。。。。 js学习中的小实操(目录) **         今天也是学习的一天,学习了知识之后,使用才能加深我们的记忆,今天做的是一个简单的实际操作,就是利用键盘事件实现小人快跑。 **        关注小文我们一起学 阅读详情

《2019年5月3日》【连续 575天】

标题:方向键控制的行走的小人.html;
内容:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        canvas {
            border: 1px solid #ccc;
        }
    </style>
</head>
<body>
<canvas width="600" height="400"></canvas>
<script>

    var Person = function (ctx) {
        /*绘制工具*/
        this.ctx = ctx || document.querySelector('canvas').getContext('2d');
        /*图片路径*/
        this.src = 'image/04.png';
        /*画布的大小*/
        this.canvasWidth = this.ctx.canvas.width;
        this.canvasHeight = this.ctx.canvas.height;

        /*行走相关参数*/
        this.stepSzie = 10;
        /* 0 前  1 左  2 右  3 后  和图片的行数包含的图片对应上*/
        this.direction = 0;
        /*x轴方向的偏移步数*/
        this.stepX = 0;
        /*y轴方向的偏移步数*/
        this.stepY = 0;

        /*初始化方法*/
        this.init();
    };

    Person.prototype.init = function () {
        var that = this;
        /*1.加载图片*/
        this.loadImage(function (image) {
            /*图片的大小*/
            that.imageWidth = image.width;
            that.imageHeight = image.height;
            /*人物的大小*/
            that.personWidth = that.imageWidth / 4;
            that.personHeight = that.imageHeight / 4;
            /*绘制图片的起点*/
            that.x0 = that.canvasWidth / 2 - that.personWidth / 2;
            that.y0 = that.canvasHeight / 2 - that.personHeight / 2;
            /*2.默认绘制在中心位置正面朝外*/
            that.ctx.drawImage(image,
                0,0,
                that.personWidth,that.personHeight,
                that.x0,that.y0,
                that.personWidth,that.personHeight);

            /*3.能通过方向键去控制人物行走*/
            that.index = 0;
            document.onkeydown = function (e) {
                if(e.keyCode == 40){
                    that.direction = 0;
                    that.stepY ++;
                    that.drawImage(image);
                    /*前*/
                }else if(e.keyCode == 37){
                    that.direction = 1;
                    that.stepX --;
                    that.drawImage(image);
                    /*左*/
                }else if(e.keyCode == 39){
                    that.direction = 2;
                    that.stepX ++;
                    that.drawImage(image);
                    /*右*/
                }else if(e.keyCode == 38){
                    that.direction = 3;
                    that.stepY --;
                    that.drawImage(image);
                    /*后*/
                }
            }
        });
    }
    /*加载图片*/
    Person.prototype.loadImage = function (callback) {
        var image = new Image();
        image.onload = function () {
            callback && callback(image);
        };
        image.src = this.src;
    };
    /*绘制图片*/
    Person.prototype.drawImage = function (image) {
        this.index ++;
        /*清除画布*/
        this.ctx.clearRect(0,0,this.canvasWidth,this.canvasHeight);
        /*绘图*/
        /*在精灵图上的定位 x  索引*/
        /*在精灵图上的定位 y  方向*/
        this.ctx.drawImage(image,
            this.index * this.personWidth,this.direction * this.personHeight,
            this.personWidth,this.personHeight,
            this.x0 + this.stepX * this.stepSzie ,this.y0 + this.stepY * this.stepSzie,
            this.personWidth,this.personHeight);
        /*如果索引超出了 变成0*/
        if(this.index >= 3){
            this.index = 0;
        }
    };


    new Person();

</script>
</body>
</html>

 

html5 人物行走 阅读详情

相关推荐

canvas绘制行走的小人

根据键盘上下左右控制小人行走的方向。 素材: 效果展示: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>行走的小人</title> <style> canvas { display: block; ...

qq_43537987的博客 1823

HTML5+CSS3+JavaScript 实现按键令小女孩移动,改变动画效果

即键盘松开时,消除动画,停止定时器,并且要改变小女孩的朝向(positionY)。不然会出现按了向下走,松开键盘时,小女孩的朝向立马变成了向上。动画就是从一个样式过渡到另一个样式,这里从坐标上可以看出来,从一个黄色框过渡到第二个,但是这样只是从图一平移到图四,并不能实现想要的逐帧动画效果。给小女孩绑定键盘按下事件,再根据键码判断上下左右来改变小女孩的朝向。按上述操作小女孩只是原地踏步,现在要来实现小女孩按朝向前进。重复代码有很多,要优化代码,设置带参函数,暂时懒得想。要从(0,0)到(0,-384)

qq_55786319的博客 2745

HTML5跑动的小人

HTML5 跑动的小人源码例子

js中键盘控制上下左右

JavaScript中用键盘实现控制小人上下左右移动: 浏览器实现效果: 代码实现: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>键盘控制特效</title> <style type="text/css"> ...

zag666的博客 1978

js键盘事件实现人物的行走

主要为大家详细介绍了js键盘事件实现人物的行走,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

抖音a_bogus参数逆向避坑指南:从环境检测到XHR请求的全流程解析

本文详细解析了抖音a_bogus参数在v1.0.1.19版本下的逆向工程全流程,重点介绍了如何通过PyV8Env框架进行有效的补环境操作,以绕过严格的环境检测。内容涵盖从环境初始化、关键事件触发到模拟XHR请求获取签名的完整步骤,并提供了可运行的Python代码示例和常见检测点的避坑指南,帮助开发者稳定生成有效的a_bogus参数。

tech5的博客 602

HTML+CSS+JS案例展示(跟随鼠标移动的小人)

跟随鼠标移动的小人js_mousemove

weixin_42541725的博客 1953

告别理论!手把手教你用Vivado 2020.2为ZYNQ PL端打造一个AXI4-Full读写DDR的IP核

本文详细介绍了如何使用Vivado 2020.2为ZYNQ PL端创建AXI4-Full主控IP核,实现高效读写DDR内存的实战指南。通过环境配置、IP核创建、系统集成到软件调试的全流程讲解,帮助开发者快速掌握AXI4-Full协议在ZYNQ平台上的应用,提升PL与PS协同工作的数据传输效率。

weixin_30300225的博客 467

HTML:用键盘实现元素的方向移动

案例:div的方向移动 body部分: <div id="ok">✈</div> style样式:自己设置大小灯样式,其中最重要的是要元素脱离文档流---不占页面位置了,其下也可以放其他元素。 #ok {position: absolute; } 补absolute:它的参照物是最近使用了定位的父级,如果没有找body。 此案例中div id="ok"的父级就是body。 首先:我们需要知道怎样将键盘中的按键与元素/对象相联系,能控制它。 这就是JS键盘事件

qq_51874203的博客 2579

RFID射频识别技术介绍及简单应用

简单介绍RFID技术及其简单应用,后附简单门禁制作方法和代码

来者皆是客。 1万+

Maven的下载安装配置教程(详细图文)

目录 一、简单了解一下什么是Maven 二、maven的下载 三、maven的安装 四、maven的环境变量配置 五、setting文件配置 六、开发工具配置Maven 一、简单了解一下什么是Maven Maven就是一款帮助程序员构建项目的工具,我们只需要告诉Maven需要哪些Jar 包,它会帮助我们下载所有的Jar,极大提升开发效率。 1.Maven翻译为“专家“, ”内行”的意思,是著名Apache公司下基于Java开发的开源项目。 2.Maven项目对象模型(POM)是一..

bakelFF的博客 12万+

使用canvas完成帧动画(方向键控制行走的小人)

&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Title&lt;/title&gt; &lt;style&gt; canvas { bord

qq_32849999的博客 3349

英飞凌 AURIX 系列单片机的HSM详解(1)——何为HSM

1. 概述 随着汽车上通信系统越来越复杂,云端远程通信的场景越来越多,信息安全变得越来越重要,在通信领域常用的AES、SHA、RSA等加密算法被越来越多地应用到汽车上。但通常这类加解密算法都需要大量的数学运算,需要消耗很多CPU时间和资源,汽车上的ECU又有比较高的实时性要求,为了节省主CPU的资源,HSM应运而生。 HSM(Hardware Security Module),是MCU上专门用于实现加解密算法的一个外设,它一般会有一个独立的CPU,专门用来进行加解密运算,还有一些针对特定算法的硬件加速器(如

weixin_42967006的博客 4万+

html5小游戏键盘控制角色移动_《创意游戏编程》第二课 键盘控制小鸟移动

演示:知乎视频​www.zhihu.com准备:1.关注大李日志,下载编辑器或直接使用线上编辑器 2.下载图片bird.png3.开始3.1 加载图片,创建画布function preload() { img = loadImage('bird.png'); } function setup() { createCanvas(400,400);//创建一个400*400的画布 } ...

weixin_29331985的博客 520

Unity类银河战士恶魔城学习总结(P103之前 Enemy相关 , 骷髅战士,状态机,敌人状态,)

udemy的Alex银河战士恶魔城,记录我自己的学习,代码会逐渐每一p更新,仅供参考学习。

suzh1qian的博客 1633

细聊Oracle通过ODBC数据源连接SQL Server数据库

    类似文章搜索引擎上有很多,内容大致相同,今天所谓细聊是因为我在借鉴这些文章时候走了些弯路,所以写此文,为自己备忘,同时如果能为初涉此处知识点的小伙伴提供些帮助就更好了,废话不多说。    我的应用场景:    项目系统使用oracle数据库,与客户的第三方系统供应商实现资源共享,对方为sql server数据库;    我的测试开发环境为64bitwin7PC机,本机上装有64位Oracl...

xueren_83的博客 1万+

html5支持左右键切换页面代码,HTML5+JS打造的一个跑动小人(左右方向键控制)...

HTML5+JS打造的一个跑动小人(左右方向键控制)_网页代码站(www.webdm.cn)您的浏览器不支持canvas标签,推荐您更换谷歌游览器,全面兼容html5。var eventjs = {//添加事件bind: function(elem, type, handler){if (elem.addEventListener) {elem.addEventListener(type, han...

weixin_39621819的博客 675

LM358模拟声音传感器原理图设计,已量产(声音传感器)

最近在做智能家居设备的声音触发模块时,搭了个基于 LM358 的模拟声音传感器电路 —— 不用复杂的专用芯片,靠通用运放就能把环境声音转化为可被单片机 AD 采集的电压信号,成本压得很低,实际调试下来灵敏度和稳定性都够用。今天把这个电路拆解开,聊聊每部分的设计思路。

不脱发的程序猿 473

奔跑的小人,在屏幕上从左向右移动”的代码实现“小人在屏幕上从右向左移动” 按下键“A”,小人向左移动;按下键“D”,小人向右移动; 按下键“W”,小人向上移动;按下键“X”,小人向下移动; 通过主函数

@T奔跑的小人,在屏幕上从左向右移动”的代码实现“小人在屏幕上从右向左移动” 按下键“A”,小人向左移动;按下键“D”,小人向右移动; 按下键“W”,小人向上移动;按下键“X”,小人向下移动; OC 新的改变`#pragma once #include using namespace std; #include<stdio.h> #include<conio.h> #include<windows.h> class Move { public: void move(in

zhan12521的博客 4131

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

小人html代码,动的小人.html

动的小人body {background:black; text-align: center;}#c1 {background:white;}window.onload=function(){let oC=document.getElementById('c1');let gd=oC.getContext('2d');let oImg=new Image();oImg.src='sprit1.jp...

weixin_34718952的博客 1597

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

html5奔跑的小人,奔跑的小人(原创)

* {padding:0;margin:0;}body {background:#333;}.man {width:100px;height:200px;position:absolute;top:200px;left:100px;animation-name:run;animation-duration:3s;animation-timing-function:linear;animation-...

weixin_29802189的博客 781

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

JavaScript之键盘练习 左右移动

键盘练习 左右移动左右移动 左右移动 <html> <head> <meta charset="utf-8"> <title>键盘事件 左右移动</title> <style> .box{ width: 100%; height: 400px; background-color: #0000FF; position: relative; } .item{ width

雪落无痕的博客 417

基于html的火柴人羽毛球游戏

一、游戏简介 火柴人羽毛球灵感来自于flash小游戏 游戏中,玩家可操作画面中的火柴人来进行羽毛球比赛 通过键盘上的左右键控制火柴人的左右移动,按上键跳跃,按下键挥拍击球 当某一方分数达到7分即判定取胜 玩家可以选择与其他玩家对战、与不同难度AI对战,以及观看AI对战 二、游戏实...

qq_38474815的博客 1513

jQuery制作一个小人移动的效果

event.keyCode===40 //获取小键盘的下方向键的ASCll码。event.keyCode===38 //获取小键盘的上方向键的ASCll码。event.keyCode===37 //获取小键盘的左方向键的ASCll码。event.keyCode===39 //获取小键盘的右方向键的ASCll码。

zzzwyZYzzy的博客 508

【Web】html中上下左右控制对象移动Demo

title>html中上下左右控制对象移动Demo--沙师弟专栏在键盘上,按上下左右,控制一个图片 在 另一个图片 上移动。

沙师弟专栏 9491

js-键盘事件案例-小人快跑

js-键盘事件案例-小人快跑 案例思路: 利用键盘的keycode判断按了上下左右什么键,然后利用键盘事件onkeydown对小人的定位进行改变即可 css部分: 由于操纵的是小人的位置,所以我们要先给小人添加一个定位 <style> #imgs { position: absolute; left: 500px; top: 20...

qq_25503949的博客 912
上一篇: 574day(帧动画.html)
下一篇: 576day(认识canvas的转换.html)
orangecloudy
博客等级 码龄9年 56粉丝 581原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值